Path: blob/master/venv/Lib/site-packages/lxml/includes/libxslt/triodef.h
811 views
/*************************************************************************1*2* $Id$3*4* Copyright (C) 2001 Bjorn Reese <[email protected]>5*6* Permission to use, copy, modify, and distribute this software for any7* purpose with or without fee is hereby granted, provided that the above8* copyright notice and this permission notice appear in all copies.9*10* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED11* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF12* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND13* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.14*15************************************************************************/1617#ifndef TRIO_TRIODEF_H18#define TRIO_TRIODEF_H1920/*************************************************************************21* Platform and compiler support detection22*/23#if defined(__GNUC__)24# define TRIO_COMPILER_GCC25#elif defined(__SUNPRO_C)26# define TRIO_COMPILER_SUNPRO27#elif defined(__SUNPRO_CC)28# define TRIO_COMPILER_SUNPRO29# define __SUNPRO_C __SUNPRO_CC30#elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)31# define TRIO_COMPILER_XLC32#elif defined(_AIX) && !defined(__GNUC__)33# define TRIO_COMPILER_XLC /* Workaround for old xlc */34#elif defined(__DECC) || defined(__DECCXX)35# define TRIO_COMPILER_DECC36#elif defined(__osf__) && defined(__LANGUAGE_C__)37# define TRIO_COMPILER_DECC /* Workaround for old DEC C compilers */38#elif defined(_MSC_VER)39# define TRIO_COMPILER_MSVC40#elif defined(__BORLANDC__)41# define TRIO_COMPILER_BCB42#endif4344#if defined(VMS) || defined(__VMS)45/*46* VMS is placed first to avoid identifying the platform as Unix47* based on the DECC compiler later on.48*/49# define TRIO_PLATFORM_VMS50#elif defined(unix) || defined(__unix) || defined(__unix__)51# define TRIO_PLATFORM_UNIX52#elif defined(TRIO_COMPILER_XLC) || defined(_AIX)53# define TRIO_PLATFORM_UNIX54#elif defined(TRIO_COMPILER_DECC) || defined(__osf___)55# define TRIO_PLATFORM_UNIX56#elif defined(__NetBSD__)57# define TRIO_PLATFORM_UNIX58#elif defined(__QNX__)59# define TRIO_PLATFORM_UNIX60# define TRIO_PLATFORM_QNX61#elif defined(__CYGWIN__)62# define TRIO_PLATFORM_UNIX63#elif defined(AMIGA) && defined(TRIO_COMPILER_GCC)64# define TRIO_PLATFORM_UNIX65#elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32)66# define TRIO_PLATFORM_WIN3267#elif defined(mpeix) || defined(__mpexl)68# define TRIO_PLATFORM_MPEIX69#endif7071#if defined(_AIX)72# define TRIO_PLATFORM_AIX73#elif defined(__hpux)74# define TRIO_PLATFORM_HPUX75#elif defined(sun) || defined(__sun__)76# if defined(__SVR4) || defined(__svr4__)77# define TRIO_PLATFORM_SOLARIS78# else79# define TRIO_PLATFORM_SUNOS80# endif81#endif8283#if defined(__STDC__) || defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB)84# define TRIO_COMPILER_SUPPORTS_C8985# if defined(__STDC_VERSION__)86# define TRIO_COMPILER_SUPPORTS_C9087# if (__STDC_VERSION__ >= 199409L)88# define TRIO_COMPILER_SUPPORTS_C9489# endif90# if (__STDC_VERSION__ >= 199901L)91# define TRIO_COMPILER_SUPPORTS_C9992# endif93# elif defined(TRIO_COMPILER_SUNPRO)94# if (__SUNPRO_C >= 0x420)95# define TRIO_COMPILER_SUPPORTS_C9496# endif97# endif98#endif99100#if defined(_XOPEN_SOURCE)101# if defined(_XOPEN_SOURCE_EXTENDED)102# define TRIO_COMPILER_SUPPORTS_UNIX95103# endif104# if (_XOPEN_VERSION >= 500)105# define TRIO_COMPILER_SUPPORTS_UNIX98106# endif107# if (_XOPEN_VERSION >= 600)108# define TRIO_COMPILER_SUPPORTS_UNIX01109# endif110#endif111112/*************************************************************************113* Generic defines114*/115116#if !defined(TRIO_PUBLIC)117# define TRIO_PUBLIC118#endif119#if !defined(TRIO_PRIVATE)120# define TRIO_PRIVATE static121#endif122123#if !(defined(TRIO_COMPILER_SUPPORTS_C89) || defined(__cplusplus))124# define TRIO_COMPILER_ANCIENT125#endif126127#if defined(TRIO_COMPILER_ANCIENT)128# define TRIO_CONST129# define TRIO_VOLATILE130# define TRIO_SIGNED131typedef double trio_long_double_t;132typedef char * trio_pointer_t;133# define TRIO_SUFFIX_LONG(x) x134# define TRIO_PROTO(x) ()135# define TRIO_NOARGS136# define TRIO_ARGS1(list,a1) list a1;137# define TRIO_ARGS2(list,a1,a2) list a1; a2;138# define TRIO_ARGS3(list,a1,a2,a3) list a1; a2; a3;139# define TRIO_ARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4;140# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5;141# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) list a1; a2; a3; a4; a5; a6;142# define TRIO_VARGS2(list,a1,a2) list a1; a2143# define TRIO_VARGS3(list,a1,a2,a3) list a1; a2; a3144# define TRIO_VARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4145# define TRIO_VARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5146# define TRIO_VA_DECL va_dcl147# define TRIO_VA_START(x,y) va_start(x)148# define TRIO_VA_END(x) va_end(x)149#else /* ANSI C */150# define TRIO_CONST const151# define TRIO_VOLATILE volatile152# define TRIO_SIGNED signed153typedef long double trio_long_double_t;154typedef void * trio_pointer_t;155# define TRIO_SUFFIX_LONG(x) x ## L156# define TRIO_PROTO(x) x157# define TRIO_NOARGS void158# define TRIO_ARGS1(list,a1) (a1)159# define TRIO_ARGS2(list,a1,a2) (a1,a2)160# define TRIO_ARGS3(list,a1,a2,a3) (a1,a2,a3)161# define TRIO_ARGS4(list,a1,a2,a3,a4) (a1,a2,a3,a4)162# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) (a1,a2,a3,a4,a5)163# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) (a1,a2,a3,a4,a5,a6)164# define TRIO_VARGS2 TRIO_ARGS2165# define TRIO_VARGS3 TRIO_ARGS3166# define TRIO_VARGS4 TRIO_ARGS4167# define TRIO_VARGS5 TRIO_ARGS5168# define TRIO_VA_DECL ...169# define TRIO_VA_START(x,y) va_start(x,y)170# define TRIO_VA_END(x) va_end(x)171#endif172173#if defined(TRIO_COMPILER_SUPPORTS_C99) || defined(__cplusplus)174# define TRIO_INLINE inline175#elif defined(TRIO_COMPILER_GCC)176# define TRIO_INLINE __inline__177#elif defined(TRIO_COMPILER_MSVC)178# define TRIO_INLINE _inline179#elif defined(TRIO_COMPILER_BCB)180# define TRIO_INLINE __inline181#else182# define TRIO_INLINE183#endif184185/*************************************************************************186* Workarounds187*/188189#if defined(TRIO_PLATFORM_VMS)190/*191* Computations done with constants at compile time can trigger these192* even when compiling with IEEE enabled.193*/194# pragma message disable (UNDERFLOW, FLOATOVERFL)195196# if (__CRTL_VER < 80000000)197/*198* Although the compiler supports C99 language constructs, the C199* run-time library does not contain all C99 functions.200*201* This was the case for 70300022. Update the 80000000 value when202* it has been accurately determined what version of the library203* supports C99.204*/205# if defined(TRIO_COMPILER_SUPPORTS_C99)206# undef TRIO_COMPILER_SUPPORTS_C99207# endif208# endif209#endif210211/*212* Not all preprocessors supports the LL token.213*/214#if defined(TRIO_COMPILER_BCB)215#else216# define TRIO_COMPILER_SUPPORTS_LL217#endif218219#endif /* TRIO_TRIODEF_H */220221222