Annotation of OpenXM_contrib2/windows/mcpp/noconfig.H, Revision 1.1
1.1 ! ohara 1: /* $OpenXM$ */
! 2: /*
! 3: * noconfig.H
! 4: * Configurations for MCPP not using config.h.
! 5: *
! 6: * WARNING: These are default settings. To configure for your system, you
! 7: * must edit this file here and there.
! 8: */
! 9:
! 10: #define TRUE 1
! 11: #define FALSE 0
! 12:
! 13: /*
! 14: * 'Target' means the O.S. and the compiler to which cpp is implemented.
! 15: * 'Host' means the O.S. and the compiler with which cpp is compiled.
! 16: */
! 17:
! 18: /* Define target operating-system. */
! 19: #ifndef SYSTEM
! 20: #define SYSTEM SYS_WIN32
! 21: #endif
! 22:
! 23: /* Define target compiler. */
! 24: #ifndef COMPILER
! 25: #define COMPILER INDEPENDENT /* compiler-independent-build */
! 26: #endif
! 27:
! 28: /* Define host operating-system. */
! 29: #define HOST_SYSTEM SYSTEM
! 30:
! 31: /* Define host compiler. */
! 32: #define HOST_COMPILER MSC
! 33:
! 34: /* Version message. */
! 35: /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
! 36: #ifndef VERSION_MSG
! 37: #define VERSION_MSG "Visual C 2008"
! 38: #endif
! 39: #if 0
! 40: "LCC-Win32 2006-03"
! 41: "Visual C 2005"
! 42: "Visual C 2008"
! 43: "BCC V.5.5"
! 44: #endif
! 45:
! 46: /*
! 47: * P A R T 1 Configurations for target-operating-system
! 48: * and target-compiler.
! 49: */
! 50:
! 51: /*
! 52: * Names of the SYSTEM (i.e. target operating system). This is needed so that
! 53: * cpp can use appropriate filename conventions.
! 54: */
! 55: #define SYS_UNKNOWN 0
! 56: #define SYS_UNIX 0x1000
! 57: #define SYS_LINUX 0x1800 /* (SYS_LINUX & 0xF000) == SYS_UNIX */
! 58: #define SYS_FREEBSD 0x1A00 /* (SYS_FREEBSD & 0xF000) == SYS_UNIX */
! 59: #define SYS_CYGWIN 0x1C00 /* (SYS_CYGWIN & 0xF000) == SYS_UNIX */
! 60: #define SYS_MAC 0x1E00 /* (SYS_MAC & 0xF000) == SYS_UNIX */
! 61: #define SYS_WIN 0x7000
! 62: #define SYS_WIN32 0x7400 /* (SYS_WIN32 & 0xF000) == SYS_WIN */
! 63: #define SYS_WIN64 0x7800 /* (SYS_WIN64 & 0xF000) == SYS_WIN */
! 64: #define SYS_MINGW 0x7C00 /* (SYS_MINGW & 0xF000) == SYS_WIN */
! 65:
! 66: /* COMPILER */
! 67: #define COMPILER_UNKNOWN 0
! 68: #define MSC 0x7400 /* Microsoft C, Visual C++ */
! 69: #define BORLANDC 0x7440 /* Borland C */
! 70: #define LCC 0x74C0 /* LCC-Win32 */
! 71: #define GNUC 0x00E0 /* GNU C (GCC) */
! 72: #define INDEPENDENT 0xFFFF /* No target, compiler-independent build*/
! 73:
! 74: #define SYS_FAMILY (SYSTEM & 0xF000)
! 75: #define COMPILER_FAMILY (COMPILER & 0xF0)
! 76: #define HOST_SYS_FAMILY (HOST_SYSTEM & 0xF000)
! 77:
! 78: /* Default MBCHAR (multi-byte character) encoding. */
! 79: #define EUC_JP 0x10 /* Extended UNIX code of JIS X 0208 */
! 80: #define GB2312 0x20 /* EUC-like encoding of Chinese GB 2312-80 */
! 81: #define KSC5601 0x30 /* EUC-like encoding of Korean KS C 5601 */
! 82: #define SJIS 0x80 /* Shift-JIS encoding of JIS X 0208 */
! 83: #define BIGFIVE 0x90 /* Encoding of Taiwanese Big Five */
! 84: #define ISO2022_JP 0x100 /* ISO-2022-JP (ISO-2022-JP1) encoding */
! 85: #define UTF8 0x1000 /* UTF-8 encoding */
! 86:
! 87: /*
! 88: * MBCHAR means multi-byte character encoding.
! 89: * MBCHAR means the default encoding, and you can change the encoding by
! 90: * #pragma MCPP setlocale, -e <encoding> option or environment variable
! 91: * LC_ALL, LC_CTYPE, LANG.
! 92: * MBCHAR == 0 means not to recognize any multi-byte character encoding.
! 93: */
! 94:
! 95: /*
! 96: * In order to predefine target-system-dependent macros,
! 97: * several macros are defined here:
! 98: * *_OLD define the macro beginning with an alphabetic letter,
! 99: * *_STD, *_STD?, *_EXT, *_EXT2 define the macro beginning with an '_'.
! 100: * *_STD1 define the macro beginning with '__' and ending with an alphanumeric
! 101: * letter.
! 102: * *_STD2 define the macro beginning with '__' and ending with '__'.
! 103: * These may not be defined, if they are not needed.
! 104: * They should not be #defined to no token or to "".
! 105: *
! 106: * SYSTEM_OLD, SYSTEM_STD1, SYSTEM_STD2, SYSTEM_EXT, SYSTEM_EXT2
! 107: * define the target operating system (by name).
! 108: * SYSTEM_SP_OLD, SYSTEM_SP_STD define the target-OS specific macro name
! 109: * COMPILER_OLD, COMPILER_STD1, COMPILER_STD2, COMPILER_EXT, COMPILER_EXT2
! 110: * , COMPILER_SP_OLD, COMPILER_SP_STD
! 111: * define the target compiler (by name).
! 112: * COMPILER_CPLUS defines the target C++ compiler.
! 113: * COMPILER_SP1, COMPILER_SP2, COMPILER_SP3
! 114: * define the compiler-specific macros.
! 115: *
! 116: * <macro>_VAL specify the value of the <macro>.
! 117: * If not specified, these values default to "1".
! 118: * To define the value of no-token, specify as "" rather than no-token.
! 119: * SYSTEM_OLD, SYSTEM_STD?, COMPILER_OLD have the value of "1".
! 120: */
! 121:
! 122: /*
! 123: * target-compiler-dependent definitions:
! 124: *
! 125: * LINE_PREFIX defines the output line prefix, if not "#line 123".
! 126: * This should be defined as "# " to represent "# 123" format
! 127: * ("#line " represents "#line 123" format).
! 128: *
! 129: * C_INCLUDE_DIR1, C_INCLUDE_DIR2 may be defined if you have a compiler-
! 130: * specific include directory which is to be searched *before*
! 131: * the operating-system specific directories (e.g. /usr/include).
! 132: * CPLUS_INCLUDE_DIR1, CPLUS_INCLUDE_DIR2, CPLUS_INCLUDE_DIR3
! 133: * , CPLUS_INCLUDE_DIR4 are for C++ include directory which exist
! 134: * other than C include directory.
! 135: * ENV_C_INCLUDE_DIR may be defined to the name of environment-variable for
! 136: * C include directory.
! 137: * ENV_CPLUS_INCLUDE_DIR is name of environment-variable for C++ include
! 138: * directory which exists other than ENV_C_INCLUDE_DIR.
! 139: * ENV_SEP is the separator (other than space) of include-paths in an
! 140: * environment-variable. e.g. the ':' in
! 141: * "/usr/abc/include:/usr/xyz/include"
! 142: *
! 143: * EMFILE should be defined to the macro to represent errno of 'too many
! 144: * open files' if the macro is different from EMFILE.
! 145: *
! 146: * ONE_PASS should be set TRUE, if COMPILER is "one pass compiler".
! 147: *
! 148: * FNAME_FOLD means that target-system folds upper and lower cases of
! 149: * directory and file-name.
! 150: *
! 151: * SEARCH_INIT specifies the default value of 'search_rule' (in system.c).
! 152: * 'search_rule' holds searching rule of #include "header.h" to
! 153: * search first before searching user specified or system-
! 154: * specific include directories.
! 155: * CURRENT means to search the directory relative to "current
! 156: * directory" which is current at cpp invocation.
! 157: * SOURCE means to search the directory relative to that of the
! 158: * source file (i.e. "includer").
! 159: * (CURRENT & SOURCE) means to search current directory first
! 160: * source directory next.
! 161: * 'search_rule' is initialized to SEARCH_INIT.
! 162: */
! 163: #define CURRENT 1
! 164: #define SOURCE 2
! 165:
! 166: #if SYS_FAMILY == SYS_UNIX
! 167: #define SYSTEM_OLD "unix"
! 168: #define SYSTEM_STD1 "__unix"
! 169: #define SYSTEM_STD2 "__unix__"
! 170:
! 171: #if SYSTEM == SYS_FREEBSD
! 172: #define SYSTEM_EXT "__FreeBSD__"
! 173: #define SYSTEM_EXT_VAL "6" /* V.5.*: 5, V.6.*:6 */
! 174: #endif
! 175:
! 176: #if SYSTEM == SYS_LINUX
! 177: #define SYSTEM_EXT "__linux__"
! 178: #endif
! 179:
! 180: #if SYSTEM == SYS_MAC /* Mac OS X */
! 181: #define SYSTEM_EXT "__APPLE__"
! 182: #define FNAME_FOLD TRUE /* Case-insensitive file-system */
! 183: #define FRAMEWORK1 "/System/Library/Frameworks"
! 184: #define FRAMEWORK2 "/Library/Frameworks"
! 185: #endif /* SYSTEM == SYS_MAC */
! 186:
! 187: #if SYSTEM == SYS_CYGWIN
! 188: #define SYSTEM_EXT "__CYGWIN__"
! 189: #define SYSTEM_EXT2 "__CYGWIN32__"
! 190: #define MBCHAR SJIS
! 191: #define FNAME_FOLD TRUE
! 192: #define CYGWIN_ROOT_DIRECTORY "c:/pub/compilers/cygwin"
! 193: #endif /* SYSTEM == SYS_CYGWIN */
! 194:
! 195: #ifndef MBCHAR
! 196: #define MBCHAR EUC_JP /* UTF8 if you like */
! 197: #endif
! 198: #ifndef FNAME_FOLD
! 199: #define FNAME_FOLD FALSE
! 200: #endif
! 201:
! 202: #endif /* SYS_FAMILY == SYS_UNIX */
! 203:
! 204: #if SYS_FAMILY == SYS_WIN
! 205:
! 206: #define SYSTEM_SP_STD "__FLAT__"
! 207: #define SYSTEM_SP_STD_VAL "1"
! 208:
! 209: #ifndef MBCHAR
! 210: #define MBCHAR SJIS /* Multi-byte char is encoded in SJIS */
! 211: #endif
! 212:
! 213: #if COMPILER == MSC
! 214: #define CMP_NAME "Visual C++"
! 215: #if _MSC_VER >= 1200 /* Visual C++ V.6.0 or later */
! 216: /* When HOST == TARGET */
! 217: #define ONE_PASS TRUE
! 218: #endif
! 219: #define COMPILER_EXT "_MSC_VER"
! 220: #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */
! 221: /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
! 222: #define COMPILER_EXT2 "_MSC_FULL_VER"
! 223: #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */
! 224: /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
! 225: /* VC 2008: "150021022" */
! 226: #define COMPILER_SP1 "_MSC_EXTENSIONS"
! 227: #define COMPILER_SP1_VAL "1"
! 228: #define COMPILER_SP2 "_INTEGRAL_MAX_BITS"
! 229: #define COMPILER_SP2_VAL "64" /* VC 2003, VC2005, VC2008: 64 */
! 230: #define TARGET_HAVE_LONG_LONG TRUE
! 231: /* __int64 instead of long long (VC 2.0 through 8.0) */
! 232: #define EXPAND_PRAGMA TRUE
! 233: #define HAVE_DIGRAPHS TRUE
! 234: #define BIGFIVE_IS_ESCAPE_FREE TRUE
! 235: #define SEARCH_INIT SOURCE
! 236:
! 237: #elif COMPILER == BORLANDC /* Borland C 5.* and C++Builder */
! 238: #define CMP_NAME "Borland C"
! 239: #define ONE_PASS TRUE
! 240: #define COMPILER_STD2 "__TURBOC__"
! 241: #if __BORLANDC__ /* Borland C */
! 242: #define COMPILER_STD2_VAL "0x0550"
! 243: /* BC 5.5: "0x0550", BC 5.9: "0x5930" */
! 244: #define COMPILER_EXT "__BORLANDC__"
! 245: #define COMPILER_EXT_VAL "0x0550"
! 246: /* BC 5.5: "0x0550", BC 5.9: "0x5930" */
! 247: #define COMPILER_CPLUS "__BCPLUSPLUS__"
! 248: #define COMPILER_CPLUS_VAL "0x0550"
! 249: /* BC 5.5: "0x0550", BC 5.9: "0x5930" */
! 250: #define EXPAND_PRAGMA TRUE
! 251: #define SEARCH_INIT (CURRENT & SOURCE)
! 252: #define TARGET_HAVE_LONG_LONG TRUE /* __int64 instead of long long */
! 253: #endif /* __BORLANDC__ */
! 254:
! 255: #elif COMPILER == LCC
! 256: #define CMP_NAME "LCC-Win32"
! 257: #define COMPILER_STD2 "__LCC__"
! 258: #define COMPILER_SP1 "__LCCDEBUGLEVEL"
! 259: #define COMPILER_SP1_VAL "0"
! 260: #define COMPILER_SP2 "__LCCOPTIMLEVEL"
! 261: #define COMPILER_SP2_VAL "0"
! 262: #define ONE_PASS TRUE
! 263: #define TARGET_HAVE_LONG_LONG TRUE
! 264: #define SJIS_IS_ESCAPE_FREE FALSE
! 265:
! 266: #endif
! 267:
! 268: #if SYSTEM == SYS_MINGW
! 269: #define SYSTEM_EXT "__MINGW__"
! 270: #define SYSTEM_EXT2 "__MINGW32__"
! 271: #define MSYS_ROOT_DIRECTORY "c:/pub/compilers/msys/1.0"
! 272: #define MINGW_DIRECTORY "c:/pub/compilers/mingw"
! 273: #if COMPILER == GNUC
! 274: #define SJIS_IS_ESCAPE_FREE FALSE
! 275: #define INC_DIR C_INCLUDE_DIR2
! 276: #endif
! 277: #endif /* SYSTEM == SYS_MINGW */
! 278:
! 279: #ifndef SJIS_IS_ESCAPE_FREE
! 280: #define SJIS_IS_ESCAPE_FREE TRUE /* or FALSE following your compiler */
! 281: #endif
! 282:
! 283: #endif /* SYS_FAMILY == SYS_WIN */
! 284:
! 285: #if COMPILER_FAMILY == GNUC
! 286: #define CMP_NAME "GCC"
! 287: #define COMPILER_EXT "__GNUC__"
! 288: #define COMPILER_EXT_VAL "3" /* "3" for V.3.* "4" for V.4.* */
! 289: #define COMPILER_EXT2 "__GNUC_MINOR__"
! 290: #define COMPILER_EXT2_VAL "4" /* "4" for V.3.4, "1" for V.4.1 */
! 291: #define COMPILER_CPLUS "__GNUG__"
! 292: #define COMPILER_CPLUS_VAL "3" /* "3" for V.3.*, "4" for V.4.* */
! 293: #define GCC_MAJOR_VERSION 3 /* Value of __GNUC__ as a digit */
! 294: #define LINE_PREFIX "# "
! 295: #ifndef HAVE_DIGRAPHS
! 296: #define HAVE_DIGRAPHS TRUE
! 297: #endif
! 298: #ifndef TARGET_HAVE_LONG_LONG
! 299: #define TARGET_HAVE_LONG_LONG TRUE
! 300: #endif
! 301: #define STDC_VERSION 0L /* 199409L for V.2.9, 0L for V.3.*,V.4.* */
! 302: #define CPLUS_INCLUDE_DIR1 "/usr/include/c++/3.4" /* "/usr/include/c++/3.3.6" */ /* "/usr/include/c++/4.1.2" */
! 303: #define CPLUS_INCLUDE_DIR2 "/usr/include/c++/3.4/backward" /* "/usr/include/c++/3.3.6/i386-vine-linux" */ /* "/usr/include/c++/4.1.2/i486-linux-gnu" */
! 304: /* #define CPLUS_INCLUDE_DIR3 */ /* "/usr/include/c++/3.3.6/backward" */ /* "/usr/include/c++/4.1.2/backward" */
! 305: /* #define C_INCLUDE_DIR1 */ /* "/usr/lib/gcc-lib/i386-vine-linux/3.3.6/include" */ /* "/usr/lib/gcc/i486-linux-gnu/4.1.2/include" */
! 306: /* #define C_INCLUDE_DIR2 */
! 307: #ifndef INC_DIR
! 308: #ifdef C_INCLUDE_DIR1
! 309: #define INC_DIR C_INCLUDE_DIR1 /* GNUC version specific dir */
! 310: #else
! 311: #define INC_DIR "/usr/local/include" /* "/usr/include" */
! 312: #endif
! 313: #endif
! 314: #ifndef ENV_C_INCLUDE_DIR
! 315: #define ENV_C_INCLUDE_DIR "C_INCLUDE_PATH"
! 316: #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE_PATH"
! 317: #endif
! 318: #define SEARCH_INIT SOURCE /* Include directory relative to source */
! 319: /*
! 320: * __SIZE_TYPE__, __PTRDIFF_TYPE__ and __WCHAR_TYPE__ are predefines of GCC.
! 321: */
! 322: #if GCC_MAJOR_VERSION < 3
! 323: #define COMPILER_SP1 "__SIZE_TYPE__"
! 324: #define COMPILER_SP2 "__PTRDIFF_TYPE__"
! 325: #define COMPILER_SP3 "__WCHAR_TYPE__"
! 326: #define COMPILER_SP1_VAL "unsigned int"
! 327: #define COMPILER_SP2_VAL "int"
! 328: #define COMPILER_SP3_VAL "int"
! 329: /* SYS_FREEBSD: "int", SYS_CYGWIN, SYS_MINGW: "short unsigned int"
! 330: , others: "long int" */
! 331: #endif /* GCC_MAJOR_VERSION < 3 */
! 332: /* On GCC V.3.*, V.4.*, these macros are known by mcpp_g*_predef_*.h files. */
! 333: #endif /* COMPILER_FAMILY == GNUC */
! 334:
! 335: #if COMPILER == INDEPENDENT
! 336: /* specifications of compiler-independent build */
! 337: #define LINE_PREFIX "#line "
! 338: #define STD_LINE_PREFIX TRUE /* Output #line by C source format */
! 339: #define HAVE_DIGRAPHS TRUE /* Output digraphs as it is */
! 340: #define SEARCH_INIT SOURCE /* Include directory relative to source */
! 341: #define SJIS_IS_ESCAPE_FREE TRUE /* Do not treat SJIS specially */
! 342: #define BIGFIVE_IS_ESCAPE_FREE TRUE /* Do not treat specially */
! 343: #define ISO2022_JP_IS_ESCAPE_FREE TRUE /* Do not treat specially */
! 344: #define TARGET_HAVE_LONG_LONG TRUE /* dummy */
! 345: #define STDC_VERSION 199409L /* Initial value of __STDC_VERSION__ */
! 346: #endif
! 347:
! 348: /*
! 349: * Each OS has some different target architectures. The followings define
! 350: * the target CPU.
! 351: * MCPP defines some predefined macros based on the CPU macro, and possibly
! 352: * redefine them on an execution time by some options.
! 353: */
! 354: #if defined (__x86_64__) || defined (__amd64__) || defined (_M_AMD64) \
! 355: || defined (_AMD64_) || defined (_X64_)
! 356: #define CPU "x86_64"
! 357: #elif defined (__ppc64__) || defined (__powerpc64__)
! 358: #define CPU "ppc64"
! 359: #elif defined (__ppc__) || defined (__powerpc__)
! 360: #define CPU "ppc"
! 361: #else /* Defaults to i386 */
! 362: #define CPU "i386"
! 363: #endif
! 364:
! 365: /*
! 366: * defaults
! 367: */
! 368:
! 369: #ifdef SYSTEM_EXT
! 370: #ifndef SYSTEM_EXT_VAL
! 371: #define SYSTEM_EXT_VAL "1"
! 372: #endif
! 373: #endif
! 374: #ifdef SYSTEM_EXT2
! 375: #ifndef SYSTEM_EXT2_VAL
! 376: #define SYSTEM_EXT2_VAL "1"
! 377: #endif
! 378: #endif
! 379: #ifdef COMPILER_STD1
! 380: #ifndef COMPILER_STD1_VAL
! 381: #define COMPILER_STD1_VAL "1"
! 382: #endif
! 383: #endif
! 384: #ifdef COMPILER_STD2
! 385: #ifndef COMPILER_STD2_VAL
! 386: #define COMPILER_STD2_VAL "1"
! 387: #endif
! 388: #endif
! 389: #ifdef COMPILER_EXT
! 390: #ifndef COMPILER_EXT_VAL
! 391: #define COMPILER_EXT_VAL "1"
! 392: #endif
! 393: #endif
! 394: #ifdef COMPILER_EXT2
! 395: #ifndef COMPILER_EXT2_VAL
! 396: #define COMPILER_EXT2_VAL "1"
! 397: #endif
! 398: #endif
! 399: #ifdef COMPILER_CPLUS
! 400: #ifndef COMPILER_CPLUS_VAL
! 401: #define COMPILER_CPLUS_VAL "1"
! 402: #endif
! 403: #endif
! 404:
! 405: #ifndef LINE_PREFIX
! 406: #define LINE_PREFIX "#line "
! 407: #define STD_LINE_PREFIX TRUE /* C source format */
! 408: #else
! 409: #ifndef STD_LINE_PREFIX
! 410: #define STD_LINE_PREFIX FALSE /* Compiler-dependent format */
! 411: #endif
! 412: #endif
! 413:
! 414: #ifndef HAVE_DIGRAPHS
! 415: #define HAVE_DIGRAPHS FALSE
! 416: #endif
! 417:
! 418: #ifndef ENV_C_INCLUDE_DIR
! 419: #define ENV_C_INCLUDE_DIR "INCLUDE"
! 420: #endif
! 421: #ifndef ENV_CPLUS_INCLUDE_DIR
! 422: #define ENV_CPLUS_INCLUDE_DIR "CPLUS_INCLUDE"
! 423: #endif
! 424:
! 425: #ifndef ENV_SEP
! 426: #if SYS_FAMILY == SYS_WIN
! 427: #define ENV_SEP ';'
! 428: #else
! 429: #define ENV_SEP ':'
! 430: #endif
! 431: #endif
! 432:
! 433: #ifndef ONE_PASS
! 434: #define ONE_PASS FALSE
! 435: #endif
! 436:
! 437: #ifndef FNAME_FOLD
! 438: #define FNAME_FOLD TRUE
! 439: #endif
! 440:
! 441: #ifndef SEARCH_INIT
! 442: #define SEARCH_INIT CURRENT
! 443: #endif
! 444:
! 445: /*
! 446: * CHARBIT, UCHARMAX are respectively CHAR_BIT, UCHAR_MAX of target compiler.
! 447: * CHARBIT should be defined to the number of bits per character.
! 448: * It is needed only for processing of multi-byte character constants.
! 449: * UCHARMAX should be defined to the maximum value of type unsigned char
! 450: * or maximum value of unsigned int which is converted from type (signed)
! 451: * char.
! 452: *
! 453: * LONGMAX should be defined to the LONG_MAX in <limits.h>.
! 454: * ULONGMAX should be defined to the ULONG_MAX in <limits.h> or LONG_MAX
! 455: * for the compiler which does not have unsigned long.
! 456: */
! 457:
! 458: #ifndef CHARBIT
! 459: #define CHARBIT 8
! 460: #endif
! 461: #ifndef UCHARMAX
! 462: #define UCHARMAX 0xFF
! 463: #endif
! 464: #ifndef LONGMAX
! 465: #define LONGMAX 0x7FFFFFFFL
! 466: #endif
! 467: #ifndef ULONGMAX
! 468: #define ULONGMAX 0xFFFFFFFFUL
! 469: #endif
! 470:
! 471: /*
! 472: * Define MBCHAR (multi-byte character encoding) to SJIS, EUC_JP or other.
! 473: */
! 474: #ifndef MBCHAR
! 475: #define MBCHAR 0
! 476: #endif
! 477:
! 478: /*
! 479: * SJIS_IS_ESCAPE_FREE means the compiler does not escape '0x5c' ('\\') in
! 480: * shift-JIS encoded multi-byte character. SJIS_IS_ESCAPE_FREE == FALSE
! 481: * enables cpp to insert * '\\' before '\\' of the 2nd byte of SJIS code in
! 482: * literal. This insertion is for the compiler-proper which can't recognize
! 483: * SJIS literal.
! 484: * BIGFIVE_IS_ESCAPE_FREE means similar case on BIGFIVE encoding.
! 485: * ISO2022_JP_IS_ESCAPE_FREE means similar case on ISO2022_JP encoding.
! 486: */
! 487: #ifndef SJIS_IS_ESCAPE_FREE
! 488: #define SJIS_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */
! 489: #endif
! 490: #ifndef BIGFIVE_IS_ESCAPE_FREE
! 491: #define BIGFIVE_IS_ESCAPE_FREE FALSE /* or TRUE following your compiler */
! 492: #endif
! 493: #ifndef ISO2022_JP_IS_ESCAPE_FREE
! 494: #define ISO2022_JP_IS_ESCAPE_FREE FALSE /* or TRUE following compiler */
! 495: #endif
! 496:
! 497: /*
! 498: * P A R T 2 Configurations for host-compiler.
! 499: *
! 500: * WARNING: In case of HOST_COMPILER differs from COMPILER, you must
! 501: * edit here and there of this part.
! 502: */
! 503: #if HOST_COMPILER == GNUC
! 504: #if __GNUC__ >= 3
! 505: #define HAVE_INTMAX_T TRUE
! 506: #define HAVE_INTTYPES_H TRUE
! 507: #define HAVE_STDINT_H TRUE
! 508: #endif
! 509: #define HOST_HAVE_LONG_LONG TRUE
! 510: #if HOST_SYSTEM == SYS_LINUX
! 511: #define HOST_HAVE_STPCPY TRUE
! 512: #endif
! 513: #if HOST_SYSTEM == SYS_MAC
! 514: #define HOST_HAVE_STPCPY TRUE
! 515: #endif
! 516:
! 517: #elif HOST_COMPILER == LCC
! 518: #define HOST_HAVE_LONG_LONG TRUE
! 519:
! 520: #elif HOST_COMPILER == MSC
! 521: #define HOST_HAVE_LONG_LONG TRUE
! 522:
! 523: #elif HOST_COMPILER == BORLANDC
! 524: #if __BORLANDC__ >= 0x550
! 525: #define HOST_HAVE_LONG_LONG TRUE
! 526: #endif
! 527: #define HOST_HAVE_STPCPY TRUE
! 528: #if __STDC__
! 529: #define stpcpy( dest, src) __stpcpy__( dest, src)
! 530: #endif
! 531: #endif
! 532:
! 533: #ifndef HAVE_INTMAX_T
! 534: #define HAVE_INTMAX_T FALSE
! 535: #endif
! 536:
! 537: /* The host compiler has the type long long int ? */
! 538: #ifndef HOST_HAVE_LONG_LONG
! 539: #define HOST_HAVE_LONG_LONG FALSE
! 540: #endif
! 541:
! 542: /*
! 543: * This definitions should be set TRUE, if *both* of the target
! 544: * and the host compilers have long long type.
! 545: */
! 546: #if TARGET_HAVE_LONG_LONG && HOST_HAVE_LONG_LONG
! 547: #define HAVE_LONG_LONG TRUE
! 548: #endif
! 549:
! 550: /*
! 551: * Define the format specifier of intmax_t or long long for
! 552: * fprintf( fp_debug,).
! 553: * Both of target COMPILER and HOST_COMPILER should have long long.
! 554: */
! 555: #if HAVE_LONG_LONG
! 556: #if HOST_COMPILER == BORLANDC \
! 557: || (HOST_COMPILER == MSC && _MSC_VER < 1400) \
! 558: || HOST_SYSTEM == SYS_MINGW
! 559: #define LL_FORM "I64" /* Format specifier for __int64 */
! 560: #endif
! 561: #ifndef LL_FORM
! 562: #define LL_FORM "ll" /* C99: for long long, "j" for intmax_t */
! 563: #endif
! 564: #endif
! 565:
! 566: #ifndef HOST_HAVE_STPCPY
! 567: #define HOST_HAVE_STPCPY FALSE
! 568: #endif
! 569:
! 570: /*
! 571: * Declaration of standard library functions and macros.
! 572: */
! 573:
! 574: /* stdin, stdout, stderr, FILE, NULL, fgets(), fputs() and other functions. */
! 575: #include "stdio.h"
! 576:
! 577: /* PATHMAX is the maximum length of path-list on the host system. */
! 578: /* _POSIX_* only to get PATH_MAX */
! 579: #define _POSIX_ 1
! 580: #define _POSIX_SOURCE 1
! 581: #ifndef _POSIX_C_SOURCE
! 582: #define _POSIX_C_SOURCE 1
! 583: #define _POSIX_C_SOURCE_defined 1
! 584: #endif
! 585: #include "limits.h"
! 586: #undef _POSIX_
! 587: #undef _POSIX_SOURCE
! 588: #ifdef _POSIX_C_SOURCE_defined
! 589: #undef _POSIX_C_SOURCE
! 590: #undef _POSIX_C_SOURCE_defined
! 591: #endif
! 592: #ifdef PATH_MAX
! 593: #define PATHMAX PATH_MAX /* Posix macro */
! 594: #else
! 595: #define PATHMAX FILENAME_MAX
! 596: #endif
! 597:
! 598: /* islower(), isupper(), toupper(), isdigit(), isxdigit(), iscntrl() */
! 599: #include "ctype.h"
! 600:
! 601: /* errno */
! 602: #include "errno.h"
! 603:
! 604: #include "string.h"
! 605: #include "stdlib.h"
! 606: #include "time.h"
! 607: #include "setjmp.h"
! 608:
! 609: /* For debugging malloc systems by kmatsui */
! 610: #if KMMALLOC && _MEM_DEBUG
! 611: #include "xalloc.h"
! 612: #endif
! 613:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>