home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / sys / cdefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  3.8 KB  |  153 lines

  1. /* Copyright (C) 1992, 1993 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef    _SYS_CDEFS_H
  20.  
  21. #define    _SYS_CDEFS_H    1
  22.  
  23. #ifdef __GNU_LIBRARY__
  24. #include <features.h>
  25. #endif
  26.  
  27. #ifdef    __GNUC__
  28.  
  29. #ifndef __P
  30. #define    __P(args)    args    /* GCC can always grok prototypes.  */
  31. #endif
  32. #define    __DOTS        , ...
  33.  
  34. /* Figure out how to declare functions that (1) depend only on their
  35.    parameters and have no side effects, or (2) don't return.  */
  36.  
  37. /*
  38. #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__cplusplus)
  39. */
  40. #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
  41.   /* Old GCC way. */
  42. #ifndef    __CONSTVALUE
  43. #define    __CONSTVALUE    __const__
  44. #define    __CONSTVALUE2
  45. #endif
  46. #ifndef    __NORETURN
  47. #define    __NORETURN    __volatile__
  48. #define    __NORETURN2
  49. #endif
  50. #else
  51.   /* New GCC way. */
  52. #ifndef    __CONSTVALUE
  53. #define    __CONSTVALUE
  54. #if defined(const) || !defined(__STDC__)
  55. #define    __CONSTVALUE2    /* We don't want empty __attribute__ (()). */
  56. #else
  57. #define    __CONSTVALUE2    __attribute__ ((const))
  58. #endif
  59. #endif
  60. #ifndef    __NORETURN
  61. #define    __NORETURN
  62. #ifdef noreturn
  63. #define    __NORETURN2    /* We don't want empty __attribute__ (()). */
  64. #else
  65. #define    __NORETURN2    __attribute__ ((noreturn))
  66. #endif
  67. #endif
  68. #endif
  69.  
  70. #else    /* Not GCC.  */
  71.  
  72. #define    __inline        /* No inline functions.  */
  73. #define    __CONSTVALUE        /* No idempotent functions.  */
  74. #define    __CONSTVALUE2
  75. #define    __NORETURN        /* No functions-of-no-return.  */
  76. #define    __NORETURN2
  77.  
  78. #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
  79.  
  80. #ifndef __P
  81. #define    __P(args)    args
  82. #endif
  83. #define    __const        const
  84. #define    __signed    signed
  85. #define    __volatile    volatile
  86. #define    __DOTS        , ...
  87.  
  88. #else    /* Not ANSI C or C++.  */
  89.  
  90. #ifndef __P
  91. #define    __P(args)    ()    /* No prototypes.  */
  92. #endif
  93. #define    __const            /* No ANSI C keywords.  */
  94. #define    __signed
  95. #define    __volatile
  96. #define    __DOTS
  97.  
  98. #endif    /* ANSI C or C++.  */
  99.  
  100. #endif    /* GCC.  */
  101.  
  102. #if defined (__GNUC__) && __GNUC__ < 2
  103. /* In GCC version 2, (__extension__ EXPR) will not complain
  104.    about GCC extensions used in EXPR under -ansi or -pedantic.  */
  105. #define    __extension__
  106. #endif
  107.  
  108. /* For these things, GCC behaves the ANSI way normally,
  109.    and the non-ANSI way under -traditional.  */
  110.  
  111. #if defined (__STDC__) && __STDC__
  112.  
  113. #define    __CONCAT(x,y)    x ## y
  114. #define    __STRING(x)    #x
  115.  
  116. /* This is not a typedef so `const __ptr_t' does the right thing.  */
  117. #define __ptr_t void *
  118. typedef long double __long_double_t;
  119.  
  120. #else
  121.  
  122. #define    __CONCAT(x,y)    x/**/y
  123. #define    __STRING(x)    "x"
  124.  
  125. #define __ptr_t char *
  126. typedef double __long_double_t;
  127.  
  128. #endif
  129.  
  130. /* The BSD header files use the ANSI keywords unmodified.  (This means that
  131.    old programs may lose if they use the new keywords as identifiers.)  We
  132.    define them to their __ versions, which are taken care of above.  */
  133.  
  134. #ifdef    __USE_BSD
  135. /* __attribute__ uses const. */
  136. #if 0
  137. #define    const        __const
  138. #endif
  139. #define    signed        __signed
  140. #define    volatile    __volatile
  141. #endif
  142.  
  143. /* C++ needs to know that types and declarations are C, not C++.  */
  144. #ifdef    __cplusplus
  145. #define    __BEGIN_DECLS    extern "C" {
  146. #define    __END_DECLS    }
  147. #else
  148. #define    __BEGIN_DECLS
  149. #define    __END_DECLS
  150. #endif
  151.  
  152. #endif     /* sys/cdefs.h */
  153.