blob: 407ea03953ab45c4bcbb427932c3ec5201f76c25 [file] [log] [blame]
Bjorn Reese45029602001-08-21 09:23:53 +00001/*************************************************************************
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
51#elif defined(AMIGA) && defined(TRIO_COMPILER_GCC)
52# define TRIO_PLATFORM_UNIX
53#elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32)
54# define TRIO_PLATFORM_WIN32
55#endif
56
57#if defined(__STDC__)
58# define TRIO_COMPILER_SUPPORTS_C90
59# if defined(__STDC_VERSION__)
60# if (__STDC_VERSION__ >= 199409L)
61# define TRIO_COMPILER_SUPPORTS_C94
62# endif
63# if (__STDC_VERSION__ >= 199901L)
64# define TRIO_COMPILER_SUPPORTS_C99
65# endif
66# elif defined(TRIO_COMPILER_SUNPRO)
67# if (__SUNPRO_C >= 0x420)
68# define TRIO_COMPILER_SUPPORTS_C94
69# endif
70# endif
71#endif
72
73#if defined(_XOPEN_SOURCE)
74# if defined(_XOPEN_SOURCE_EXTENDED)
75# define TRIO_COMPILER_SUPPORTS_UNIX95
76# endif
77# if (_XOPEN_VERSION >= 500)
78# define TRIO_COMPILER_SUPPORTS_UNIX98
79# endif
80#endif
81
82#endif /* __TRIO_TRIODEF_H__ */