Xosdefs.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * O/S-dependent (mis)feature macro definitions
  3. *
  4. Copyright 1991, 1998 The Open Group
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation.
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  16. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. Except as contained in this notice, the name of The Open Group shall not be
  19. used in advertising or otherwise to promote the sale, use or other dealings
  20. in this Software without prior written authorization from The Open Group.
  21. */
  22. #ifndef _XOSDEFS_H_
  23. # define _XOSDEFS_H_
  24. /*
  25. * X_NOT_POSIX means does not have POSIX header files. Lack of this
  26. * symbol does NOT mean that the POSIX environment is the default.
  27. * You may still have to define _POSIX_SOURCE to get it.
  28. */
  29. # ifdef _SCO_DS
  30. # ifndef __SCO__
  31. # define __SCO__
  32. # endif
  33. # endif
  34. # ifdef __i386__
  35. # ifdef SYSV
  36. # if !defined(__SCO__) && \
  37. !defined(__UNIXWARE__) && !defined(__sun)
  38. # if !defined(_POSIX_SOURCE)
  39. # define X_NOT_POSIX
  40. # endif
  41. # endif
  42. # endif
  43. # endif
  44. # ifdef __sun
  45. /* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
  46. * This check allows non-Imake configured programs to build correctly.
  47. */
  48. # if defined(__SVR4) && !defined(SVR4)
  49. # define SVR4 1
  50. # endif
  51. # ifdef SVR4
  52. /* define this to whatever it needs to be */
  53. # define X_POSIX_C_SOURCE 199300L
  54. # endif
  55. # endif
  56. # ifdef WIN32
  57. # ifndef _POSIX_
  58. # define X_NOT_POSIX
  59. # endif
  60. # endif
  61. # ifdef __APPLE__
  62. # define NULL_NOT_ZERO
  63. /* Defining any of these will sanitize the namespace to JUST want is defined by
  64. * that particular standard. If that happens, we don't get some expected
  65. * prototypes, typedefs, etc (like fd_mask). We can define _DARWIN_C_SOURCE to
  66. * loosen our belts a tad.
  67. */
  68. # if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
  69. # ifndef _DARWIN_C_SOURCE
  70. # define _DARWIN_C_SOURCE
  71. # endif
  72. # endif
  73. # endif
  74. # ifdef __GNU__
  75. # ifndef PATH_MAX
  76. # define PATH_MAX 4096
  77. # endif
  78. # ifndef MAXPATHLEN
  79. # define MAXPATHLEN 4096
  80. # endif
  81. # endif
  82. # if defined(__SCO__) || defined(__UNIXWARE__)
  83. # ifndef PATH_MAX
  84. # define PATH_MAX 1024
  85. # endif
  86. # ifndef MAXPATHLEN
  87. # define MAXPATHLEN 1024
  88. # endif
  89. # endif
  90. # if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
  91. || defined(__APPLE__) || defined(__DragonFly__)
  92. # ifndef CSRG_BASED
  93. # define CSRG_BASED
  94. # endif
  95. # endif
  96. #endif /* _XOSDEFS_H_ */