Bjorn Reese | 4502960 | 2001-08-21 09:23:53 +0000 | [diff] [blame] | 1 | /************************************************************************* |
| 2 | * |
| 3 | * $Id$ |
| 4 | * |
| 5 | * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net> |
| 6 | * |
| 7 | * Permission to use, copy, modify, and distribute this software for any |
| 8 | * purpose with or without fee is hereby granted, provided that the above |
| 9 | * copyright notice and this permission notice appear in all copies. |
| 10 | * |
| 11 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED |
| 12 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
| 13 | * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND |
| 14 | * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. |
| 15 | * |
| 16 | ************************************************************************/ |
| 17 | |
| 18 | #ifndef __TRIO_TRIODEF_H__ |
| 19 | #define __TRIO_TRIODEF_H__ |
| 20 | |
| 21 | /************************************************************************* |
| 22 | * Platform and compiler support detection |
| 23 | */ |
| 24 | #if defined(__GNUC__) |
| 25 | # define TRIO_COMPILER_GCC |
| 26 | #elif defined(__SUNPRO_C) |
| 27 | # define TRIO_COMPILER_SUNPRO |
| 28 | #elif defined(__SUNPRO_CC) |
| 29 | # define TRIO_COMPILER_SUNPRO |
| 30 | # define __SUNPRO_C __SUNPRO_CC |
| 31 | #elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) |
| 32 | # define TRIO_COMPILER_XLC |
| 33 | #elif defined(_AIX) && !defined(__GNUC__) |
| 34 | # define TRIO_COMPILER_XLC /* Workaround for old xlc */ |
| 35 | #elif defined(__DECC) || defined(__DECCXX) |
| 36 | # define TRIO_COMPILER_DECC |
| 37 | #elif defined(_MSC_VER) |
| 38 | # define TRIO_COMPILER_MSVC |
| 39 | #endif |
| 40 | |
| 41 | #if defined(unix) || defined(__unix) || defined(__unix__) |
| 42 | # define TRIO_PLATFORM_UNIX |
| 43 | #elif defined(TRIO_COMPILER_XLC) || defined(_AIX) |
| 44 | # define TRIO_PLATFORM_UNIX |
| 45 | #elif defined(TRIO_COMPILER_DECC) || defined(__osf__) |
| 46 | # define TRIO_PLATFORM_UNIX |
| 47 | #elif defined(__NetBSD__) |
| 48 | # define TRIO_PLATFORM_UNIX |
| 49 | #elif defined(__QNX__) |
| 50 | # define TRIO_PLATFORM_UNIX |
Daniel Veillard | 3c5ed91 | 2002-01-08 10:36:16 +0000 | [diff] [blame] | 51 | #elif defined(__CYGWIN__) |
| 52 | # define TRIO_PLATFORM_UNIX |
Bjorn Reese | 4502960 | 2001-08-21 09:23:53 +0000 | [diff] [blame] | 53 | #elif defined(AMIGA) && defined(TRIO_COMPILER_GCC) |
| 54 | # define TRIO_PLATFORM_UNIX |
| 55 | #elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32) |
| 56 | # define TRIO_PLATFORM_WIN32 |
| 57 | #endif |
| 58 | |
| 59 | #if defined(__STDC__) |
| 60 | # define TRIO_COMPILER_SUPPORTS_C90 |
| 61 | # if defined(__STDC_VERSION__) |
| 62 | # if (__STDC_VERSION__ >= 199409L) |
| 63 | # define TRIO_COMPILER_SUPPORTS_C94 |
| 64 | # endif |
| 65 | # if (__STDC_VERSION__ >= 199901L) |
| 66 | # define TRIO_COMPILER_SUPPORTS_C99 |
| 67 | # endif |
| 68 | # elif defined(TRIO_COMPILER_SUNPRO) |
| 69 | # if (__SUNPRO_C >= 0x420) |
| 70 | # define TRIO_COMPILER_SUPPORTS_C94 |
| 71 | # endif |
| 72 | # endif |
| 73 | #endif |
| 74 | |
| 75 | #if defined(_XOPEN_SOURCE) |
| 76 | # if defined(_XOPEN_SOURCE_EXTENDED) |
| 77 | # define TRIO_COMPILER_SUPPORTS_UNIX95 |
| 78 | # endif |
| 79 | # if (_XOPEN_VERSION >= 500) |
| 80 | # define TRIO_COMPILER_SUPPORTS_UNIX98 |
| 81 | # endif |
| 82 | #endif |
| 83 | |
| 84 | #endif /* __TRIO_TRIODEF_H__ */ |