home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / misc / sys / cdefs.h next >
Encoding:
C/C++ Source or Header  |  1992-05-23  |  2.4 KB  |  95 lines

  1. /* Copyright (C) 1992 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. #include <features.h>
  23.  
  24. #ifdef __GNUC__
  25.  
  26. #define    __P(args)    args    /* GCC can always grok prototypes.  */
  27. #define    __DOTS        , ...
  28.  
  29. #else    /* Not GCC.  */
  30.  
  31. #define    __inline        /* No inline functions.  */
  32.  
  33. #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
  34.  
  35. #define    __P(args)    args
  36. #define    __const        const
  37. #define    __signed    signed
  38. #define    __volatile    volatile
  39. #define    __DOTS        , ...
  40.  
  41. #else    /* Not ANSI C or C++.  */
  42.  
  43. #define    __P(args)    ()    /* No prototypes.  */
  44. #define    __const            /* No ANSI C keywords.  */
  45. #define    __signed
  46. #define    __volatile
  47. #define    __DOTS
  48.  
  49. #endif    /* ANSI C or C++.  */
  50.  
  51. #endif    /* GCC.  */
  52.  
  53. /* For these things, GCC behaves the ANSI way normally,
  54.    and the non-ANSI way under -traditional.  */
  55.  
  56. #if defined (__STDC__) && __STDC__
  57.  
  58. #define    __CONCAT(x,y)    x ## y
  59. #define    __STRING(x)    #x
  60.  
  61. /* This is not a typedef so `const __ptr_t' does the right thing.  */
  62. #define __ptr_t void *
  63. typedef long double __long_double_t;
  64.  
  65. #else
  66.  
  67. #define    __CONCAT(x,y)    x/**/y
  68. #define    __STRING(x)    "x"
  69.  
  70. #define __ptr_t char *
  71. typedef double __long_double_t;
  72.  
  73. #endif
  74.  
  75. /* The BSD header files use the ANSI keywords unmodified.  (This means that
  76.    old programs may lose if they use the new keywords as identifiers.)  We
  77.    define them to their __ versions, which are taken care of above.  */
  78.  
  79. #ifdef    __USE_BSD
  80. #define    const        __const
  81. #define    signed        __signed
  82. #define    volatile    __volatile
  83. #endif
  84.  
  85. /* C++ needs to know that types and declarations are C, not C++.  */
  86. #ifdef    __cplusplus
  87. #define    __BEGIN_DECLS    extern "C" {
  88. #define    __END_DECLS    }
  89. #else
  90. #define    __BEGIN_DECLS
  91. #define    __END_DECLS
  92. #endif
  93.  
  94. #endif     /* sys/cdefs.h */
  95.