]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compatibility/generate_cpp_c_headers.py
1 # This Python script creates a full set of C++ C header files that
2 # are missing on some platforms.
7 # python generate_cpp_c_headers.py
9 # The files created by this script are in the directory:
10 # root/boost/compatibility/cpp_c_headers
12 # Supported platforms:
13 # Compaq Alpha, RedHat 6.2 Linux, Compaq C++ V6.3 (cxx)
14 # Compaq Alpha, Tru64 Unix V5.0, Compaq C++ V6.2 (cxx)
15 # Silicon Graphics, IRIX 6.5, MIPSpro Compilers: Version 7.3.1.1m (CC)
17 # Support for additional platforms can be added by extending the
18 # "defines" Python dictionary below.
20 # Python is available at:
21 # http://www.python.org/
23 # Copyright (c) 2001 Ralf W. Grosse-Kunstleve.
24 # Distributed under the Boost Software License, Version 1.0. (See accompany-
25 # ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
28 # 16 Apr 01 moved to boost CVS tree (R.W. Grosse-Kunstleve)
29 # 17 Jan 01 Alpha Linux cxx V6.3 support (R.W. Grosse-Kunstleve)
30 # 15 Dec 00 posted to boost e-group file upload area (R.W. Grosse-Kunstleve)
32 # Definition of platform specific exclusion of identifiers.
34 'defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 740': (
35 'btowc', 'fwide', 'fwprintf', 'fwscanf', 'mbrlen', 'mbrtowc',
36 'mbsinit', 'mbsrtowcs', 'swprintf', 'swscanf', 'towctrans', 'vfwprintf',
37 'vswprintf', 'vwprintf', 'wcrtomb', 'wcsrtombs', 'wctob', 'wctrans',
38 'wctrans_t', 'wmemchr', 'wmemcmp', 'wmemcpy', 'wmemmove', 'wmemset',
41 'defined(__DECCXX_VER) && __DECCXX_VER <= 60290024': (
44 'defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005': (
45 'getwchar', 'ungetwc', 'fgetwc', 'vfwprintf', 'fgetws', 'vswprintf',
46 'wcsftime', 'fputwc', 'vwprintf', 'fputws', 'fwide', 'putwc',
47 'wprintf', 'fwprintf', 'putwchar', 'wscanf', 'fwscanf', 'swprintf',
52 # The information below was copied directly from the file:
53 # ISO+IEC+14882-1998.pdf
54 # The exact source of the information is given in the format
55 # PDF #, p. #, Table #
57 # PDF # = page number as shown by the Acrobat Reader
58 # p. # = page number printed at the bottom of the page
59 # Table # = number printed in caption of table
61 'cassert': ( # PDF 378, p. 352, Table 25
64 'cctype': ( # PDF 431, p. 405, Table 45
66 'isalnum', 'isdigit', 'isprint', 'isupper', 'tolower',
67 'isalpha', 'isgraph', 'ispunct', 'isxdigit', 'toupper',
68 'iscntrl', 'islower', 'isspace',
70 'cerrno': ( # PDF 378, p. 352, Table 26
71 # Macros: EDOM ERANGE errno
73 'cfloat': ( # PDF 361, p. 335, Table 17
74 # Macros: DBL_DIG DBL_MIN_EXP FLT_MIN_10_EXP LDBL_MAX_10_EXP
75 # DBL_EPSILON FLT_DIG FLT_MIN_EXP LDBL_MAX_EXP
76 # DBL_MANT_DIG FLT_EPSILON FLT_RADIX LDBL_MIN
77 # DBL_MAX FLT_MANT_DIG FLT_ROUNDS LDBL_MIN_10_EXP
78 # DBL_MAX_10_EXP FLT_MAX LDBL_DIG LDBL_MIN_EXP
79 # DBL_MAX_EXP FLT_MAX_10_EXP LDBL_EPSILON
80 # DBL_MIN FLT_MAX_EXP LDBL_MANT_DIG
81 # DBL_MIN_10_EXP FLT_MIN LDBL_MAX
85 'climits': ( # PDF 361, p. 335, Table 16
86 # Macros: CHAR_BIT INT_MAX LONG_MIN SCHAR_MIN UCHAR_MAX USHRT_MAX
87 # CHAR_MAX INT_MIN MB_LEN_MAX SHRT_MAX UINT_MAX
88 # CHAR_MIN LONG_MAX SCHAR_MAX SHRT_MIN ULONG_MAX
90 'clocale': ( # PDF 483, p. 457, Table 62
91 # Macros: LC_ALL LC_COLLATE LC_CTYPE
92 # LC_MONETARY LC_NUMERIC LC_TIME
97 'localeconv', 'setlocale',
99 'cmath': ( # PDF 622, p. 596, Table 80
102 'acos', 'cos', 'fmod', 'modf', 'tan',
103 'asin', 'cosh', 'frexp', 'pow', 'tanh',
104 'atan', 'exp', 'ldexp', 'sin',
105 'atan2', 'fabs', 'log', 'sinh',
106 'ceil', 'floor', 'log10', 'sqrt',
108 'csetjmp': ( # PDF 372, p. 346, Table 20
115 'csignal': ( # PDF 372, p. 346, Table 22
116 # Macros: SIGABRT SIGILL SIGSEGV SIG_DFL
117 # SIG_IGN SIGFPE SIGINT SIGTERM SIG_ERR
123 'cstdarg': ( # PDF 372, p. 346, Table 19
124 # Macros: va_arg va_end va_start
128 'cstddef': ( # PDF 353, p. 327, Table 15
129 # Macros: NULL offsetof
131 'ptrdiff_t', 'size_t',
133 'cstdio': ( # PDF 692, p. 666, Table 94
134 # Macros: BUFSIZ FOPEN_MAX SEEK_CUR TMP_MAX _IONBF stdout
135 # EOF L_tmpnam SEEK_END _IOFBF stderr
136 # FILENAME_MAX NULL <cstdio> SEEK_SET _IOLBF stdin
138 'FILE', 'fpos_t', 'size_t',
140 'clearerr', 'fgets', 'fscanf', 'gets', 'rename', 'tmpfile',
141 'fclose', 'fopen', 'fseek', 'perror', 'rewind', 'tmpnam',
142 'feof', 'fprintf', 'fsetpos', 'printf', 'scanf', 'ungetc',
143 'ferror', 'fputc', 'ftell', 'putc', 'setbuf', 'vfprintf',
144 'fflush', 'fputs', 'fwrite', 'putchar', 'setvbuf', 'vprintf',
145 'fgetc', 'fread', 'getc', 'puts', 'sprintf', 'vsprintf',
146 'fgetpos', 'freopen', 'getchar', 'remove', 'sscanf',
148 'cstdlib': ( # PDF 362, p. 336, Table 18
149 # Macros: EXIT_FAILURE EXIT_SUCCESS
151 'abort', 'atexit', 'exit',
152 # PDF 373, p. 347, Table 23
155 # PDF 400, p. 374, Table 33
159 # PDF 433, p. 417, Table 49
162 'atol', 'mblen', 'strtod', 'wctomb',
163 'atof', 'mbstowcs', 'strtol', 'wcstombs',
164 'atoi', 'mbtowc', 'strtoul',
165 # PDF 589, p. 563, Table 78
168 # PDF 622, p. 596, Table 81
173 'abs', 'labs', 'srand',
174 'div', 'ldiv', 'rand',
176 'cstring': ( # PDF 401, p. 375, Table 34
180 # 'memchr', 'memcmp',
181 # 'memcpy', 'memmove', 'memset',
182 # PDF 432, p. 406, Table 47
187 'memchr', 'strcat', 'strcspn', 'strncpy', 'strtok',
188 'memcmp', 'strchr', 'strerror', 'strpbrk', 'strxfrm',
189 'memcpy', 'strcmp', 'strlen', 'strrchr',
190 'memmove', 'strcoll', 'strncat', 'strspn',
191 'memset', 'strcpy', 'strncmp', 'strstr',
193 'ctime': ( # PDF 372, p. 346, Table 21
194 # Macros: CLOCKS_PER_SEC
199 # PDF 401, p. 375, Table 35
202 'size_t', 'clock_t', 'time_t',
206 'asctime', 'clock', 'difftime', 'localtime', 'strftime',
207 'ctime', 'gmtime', 'mktime', 'time',
209 'cwchar': ( # PDF 432, p. 406, Table 48
210 # Macros: NULL WCHAR_MAX WCHAR_MIN WEOF
212 'mbstate_t', 'wint_t', 'size_t',
214 'btowc', 'getwchar', 'ungetwc', 'wcscpy', 'wcsrtombs', 'wmemchr',
215 'fgetwc', 'mbrlen', 'vfwprintf', 'wcscspn', 'wcsspn', 'wmemcmp',
216 'fgetws', 'mbrtowc', 'vswprintf', 'wcsftime', 'wcsstr', 'wmemcpy',
217 'fputwc', 'mbsinit', 'vwprintf', 'wcslen', 'wcstod', 'wmemmove',
218 'fputws', 'mbsrtowcs', 'wcrtomb', 'wcsncat', 'wcstok', 'wmemset',
219 'fwide', 'putwc', 'wcscat', 'wcsncmp', 'wcstol', 'wprintf',
220 'fwprintf', 'putwchar', 'wcschr', 'wcsncpy', 'wcstoul', 'wscanf',
221 'fwscanf', 'swprintf', 'wcscmp', 'wcspbrk', 'wcsxfrm',
222 'getwc', 'swscanf', 'wcscoll', 'wcsrchr', 'wctob',
224 'cwctype': ( # PDF 432, p. 406, Table 46
227 'wctrans_t', 'wctype_t', 'wint_t',
229 'iswalnum', 'iswctype', 'iswlower', 'iswspace', 'towctrans', 'wctrans',
230 'iswalpha', 'iswdigit', 'iswprint', 'iswupper', 'towlower', 'wctype',
231 'iswcntrl', 'iswgraph', 'iswpunct', 'iswxdigit', 'towupper',
235 if (__name__
== "__main__"):
237 import sys
, string
, time
239 now
= time
.asctime(time
.localtime(time
.time())) + ' ' + str(time
.tzname
)
241 for hfile
in hfiles
.keys():
242 HFILE
= string
.upper(hfile
)
245 print '// This file is automatically generated. Do not edit.'
249 print '#ifndef __' + HFILE
+ '_HEADER'
250 print '#define __' + HFILE
+ '_HEADER'
252 print '#include <' + hfile
[1:] + '.h>'
254 if (len(hfiles
[hfile
]) > 0):
255 print 'namespace std {'
256 for s
in hfiles
[hfile
]:
258 for d
in defines
.keys():
259 if (s
in defines
[d
]):
260 print '#if !(' + d
+ ')'
261 n_endif
= n_endif
+ 1
262 print ' using ::' + s
+ ';'
263 for i
in xrange(n_endif
): print '#endif'
266 print '#endif // ' + HFILE
+ '_HEADER'
267 sys
.stdout
= sys
.__stdout
__