EUSCompat.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. *+SNOTICE
  25. *
  26. * $TOG: EUSCompat.h /main/4 1998/04/03 17:11:57 mgreess $
  27. *
  28. * RESTRICTED CONFIDENTIAL INFORMATION:
  29. *
  30. * The information in this document is subject to special
  31. * restrictions in a confidential disclosure agreement bertween
  32. * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
  33. * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
  34. * Sun's specific written approval. This documment and all copies
  35. * and derivative works thereof must be returned or destroyed at
  36. * Sun's request.
  37. *
  38. * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
  39. *
  40. *+ENOTICE
  41. */
  42. #ifndef _EUSCOMPAT_H
  43. #define _EUSCOMPAT_H
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. #if defined(SunOS)
  48. #if (RELMAJOR==5)
  49. #if (RELMINOR<2)
  50. #define STRCASECMP_NOT_DEFINED
  51. #endif /* RELMINOR */
  52. #endif /* RELMAJOR */
  53. #endif
  54. /*
  55. ** System V R4 based systems define the stuff we need in
  56. ** sys/types.h. Include that and then we are done.
  57. */
  58. #if defined(HPUX) || defined(linux) || defined(SunOS) || defined(UNIX_SV) || defined(USL) || defined(__uxp__)
  59. #include <sys/types.h>
  60. #endif
  61. #if defined(sun) && defined(_XOPEN_SOURCE)
  62. #ifndef B_TRUE
  63. #define B_TRUE _B_TRUE
  64. #endif
  65. #ifndef B_FALSE
  66. #define B_FALSE _B_FALSE
  67. #endif
  68. #endif /* sun && _XOPEN_SOURCE */
  69. /*
  70. ** HPUX defines most of what we need, if we set the right
  71. ** include options before including the system files.
  72. */
  73. #if defined(HPUX)
  74. #ifndef _INCLUDE_POSIX_SOURCE
  75. #define _INCLUDE_POSIX_SOURCE
  76. #endif
  77. #ifndef _INCLUDE_XOPEN_SOURCE
  78. #define _INCLUDE_XOPEN_SOURCE
  79. #endif
  80. #ifndef _INCLUDE_AES_SOURCE
  81. #define _INCLUDE_AES_SOURCE
  82. #endif
  83. #ifndef _INCLUDE_HPUX_SOURCE
  84. #define _INCLUDE_HPUX_SOURCE
  85. #endif
  86. #ifndef hpV4
  87. typedef unsigned long ulong_t;
  88. #endif /* hpV4 */
  89. typedef unsigned char uchar_t;
  90. typedef enum {B_FALSE, B_TRUE} boolean_t;
  91. #define _SC_PAGESIZE _SC_PAGE_SIZE
  92. #ifndef MAXPATHLEN
  93. #include <sys/param.h>
  94. #endif
  95. #define MAXNAMELEN 256
  96. #endif /* HPUX */
  97. #if defined(linux) || defined(CSRG_BASED)
  98. typedef enum {B_FALSE, B_TRUE} boolean_t;
  99. #define MAXNAMELEN 256
  100. #if !defined(__FreeBSD__)
  101. #define iconv_t int
  102. #define iconv_open(a, b) ((iconv_t) -1)
  103. #define iconv(a, b, c, d, e) ((size_t) 0)
  104. #define iconv_close(a) (0)
  105. #endif
  106. #endif
  107. /*
  108. ** AIX, like HPUX defines most of what we need.
  109. */
  110. #if defined(AIX)
  111. #ifndef KERNEL
  112. #define KERNEL
  113. #endif
  114. #ifndef _BSD_INCLUDES
  115. #define _BSD_INCLUDES
  116. #endif
  117. #include <sys/types.h>
  118. #define _SC_PAGESIZE _SC_PAGE_SIZE
  119. #define vfork fork
  120. #ifndef MAXPATHLEN
  121. #include <sys/param.h>
  122. #endif
  123. #define MAXNAMELEN 256
  124. #ifndef _POWER
  125. typedef enum {B_FALSE, B_TRUE} boolean_t;
  126. #else /* _POWER */
  127. #ifndef B_FALSE
  128. #define B_FALSE 0
  129. #endif
  130. #ifndef B_TRUE
  131. #define B_TRUE 1
  132. #endif
  133. #endif /* _POWER */
  134. #undef BIG_ENDIAN
  135. #endif /* AIX */
  136. #if defined(USL) || defined(__uxp__)
  137. #include <sys/param.h>
  138. #define STRCASECMP_NOT_DEFINED
  139. #if !defined(S_ISLNK)
  140. #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
  141. #endif
  142. #endif
  143. /*
  144. * A bug in Solaris 2.1 and the GNU compilers, these are not defined.
  145. */
  146. #ifdef STRCASECMP_NOT_DEFINED
  147. extern int strcasecmp(const char *, const char *);
  148. extern int strncasecmp(const char *, const char *, size_t);
  149. #endif
  150. /*
  151. **
  152. */
  153. #if defined(__osf__)
  154. #define vfork fork
  155. #include <sys/types.h>
  156. #ifndef MAXPATHLEN
  157. #include <sys/param.h>
  158. #endif
  159. #ifndef MAXNAMELEN
  160. #define MAXNAMELEN 256
  161. #endif
  162. typedef enum {B_FALSE, B_TRUE} boolean_t;
  163. #undef BIG_ENDIAN
  164. #endif /* __osf__ */
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168. #endif