You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
4.2 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/util/nulldef.h
  3. *
  4. * Purpose: Include for defining NULL to be the NULL_v template class.
  5. *
  6. * Created: 17th December 2002
  7. * Updated: 3rd February 2012
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2002-2012, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file stlsoft/util/nulldef.h
  40. *
  41. * \brief [C++ only] Defines the NULL preprocessor symbol as
  42. * stlsoft::NULL_v()
  43. * (\ref group__library__utility "Utility" Library).
  44. */
  45. #ifndef STLSOFT_INCL_STLSOFT_UTIL_H_NULLDEF
  46. #define STLSOFT_INCL_STLSOFT_UTIL_H_NULLDEF
  47. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  48. # define STLSOFT_VER_STLSOFT_UTIL_H_NULLDEF_MAJOR 4
  49. # define STLSOFT_VER_STLSOFT_UTIL_H_NULLDEF_MINOR 0
  50. # define STLSOFT_VER_STLSOFT_UTIL_H_NULLDEF_REVISION 3
  51. # define STLSOFT_VER_STLSOFT_UTIL_H_NULLDEF_EDIT 29
  52. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  53. /* /////////////////////////////////////////////////////////////////////////
  54. * Auto-generation and compatibility
  55. */
  56. /*
  57. [<[STLSOFT-AUTO:NO-UNITTEST]>]
  58. */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Includes
  61. */
  62. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  63. # include <stlsoft/stlsoft.h>
  64. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  65. #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_NULL
  66. # include <stlsoft/util/null.hpp>
  67. #endif /* !STLSOFT_INCL_STLSOFT_UTIL_HPP_NULL */
  68. #ifndef STLSOFT_INCL_H_STDDEF
  69. # define STLSOFT_INCL_H_STDDEF
  70. # include <stddef.h> // Always make sure that this is included, irrespective of
  71. // its potential inclusion within stlsoft/stlsoft.h
  72. #endif /* !STLSOFT_INCL_H_STDDEF */
  73. /* /////////////////////////////////////////////////////////////////////////
  74. * Definitions
  75. */
  76. #ifndef NULL
  77. # ifdef STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT
  78. # pragma message("NULL not defined. This is potentially dangerous. You are advised to include its defining header before stlsoft_nulldef.h")
  79. # endif /* STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT */
  80. #endif /* !NULL */
  81. #ifdef _STLSOFT_NULL_v_DEFINED
  82. # ifdef __cplusplus
  83. # ifdef NULL
  84. # undef NULL
  85. # endif /* NULL */
  86. /// \def NULL
  87. ///
  88. /// By including this file, \c NULL is (re-)defined to be <code>stlsoft::NULL_v()</code>
  89. /// which means that any use of \c NULL must be with pointer types.
  90. # define NULL stlsoft_ns_qual(NULL_v)::create()
  91. # endif /* __cplusplus */
  92. #endif /* _STLSOFT_NULL_v_DEFINED */
  93. /* ////////////////////////////////////////////////////////////////////// */
  94. #endif /* !STLSOFT_INCL_STLSOFT_UTIL_H_NULLDEF */
  95. /* ///////////////////////////// end of file //////////////////////////// */