From aba5c40b1742e93af434269f8b9b733e405f7b84 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sun, 16 Nov 2003 14:11:28 +0000 Subject: [PATCH] New ACC version. committer: mfx 1068991888 +0000 --- src/acc/.cvsignore | 1 + src/acc/acc.h | 6 ++++-- src/acc/acc_defs.h | 25 ++++++++++++++----------- src/acc/acc_type.h | 7 +++---- 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 src/acc/.cvsignore diff --git a/src/acc/.cvsignore b/src/acc/.cvsignore new file mode 100644 index 00000000..59a46577 --- /dev/null +++ b/src/acc/.cvsignore @@ -0,0 +1 @@ +GNUmakefile diff --git a/src/acc/acc.h b/src/acc/acc.h index d60dd032..b5d82456 100644 --- a/src/acc/acc.h +++ b/src/acc/acc.h @@ -19,13 +19,15 @@ * ACC_CONFIG_NO_HEADER * ACC_CONFIG_HEADER if given, then use this as * ACC_CONFIG_INCLUDE include path to acc_ files + * + * ACC_CONFIG_PREFER___INT64 [acc_type.h] */ #ifndef __ACC_H_INCLUDED #define __ACC_H_INCLUDED 1 -#define ACC_VERSION 20031020L +#define ACC_VERSION 20031115L #if !defined(ACC_CONFIG_INCLUDE) # define ACC_CONFIG_INCLUDE(file) file @@ -38,7 +40,7 @@ #if defined(__IBMCPP__) && !defined(__IBMC__) # define __IBMC__ __IBMCPP__ #endif -#if defined(__ICL) && !defined(__INTEL_COMPILER) +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) # define __INTEL_COMPILER __ICL #endif diff --git a/src/acc/acc_defs.h b/src/acc/acc_defs.h index 200749d8..484ede6c 100644 --- a/src/acc/acc_defs.h +++ b/src/acc/acc_defs.h @@ -41,30 +41,33 @@ /*********************************************************************** // compile-time-assertions -// -// The "switch" version works on all compilers, whereas the "typedef" gets -// ignored or misinterpreted (e.g. implicit cast from -1 to unsigned long) -// on some systems. OTOS, on modern compilers, the "switch" version -// may produce a pedantic warning about "selector expr. is constant". ************************************************************************/ -/* This can be put into a header file but may get ignored by some compilers */ +/* This can be put into a header file but may get ignored by some compilers. */ #if !defined(ACC_COMPILE_TIME_ASSERT_HEADER) # if (ACC_CC_AZTECC || ACC_CC_ZORTECHC) -# define ACC_COMPILE_TIME_ASSERT_HEADER(e) {typedef int __acc_cta[1-!(e)];} +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)]; +# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)]; +# elif (ACC_CC_DMC || ACC_CC_SYMANTECC) +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)]; # else -# define ACC_COMPILE_TIME_ASSERT_HEADER(e) {typedef int __acc_cta[1-2*!(e)];} +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)]; # endif #endif -/* This must appear within a function body */ +/* This must appear within a function body. */ #if !defined(ACC_COMPILE_TIME_ASSERT) -# if (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) +# if (ACC_CC_AZTECC) +# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];} +# elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) # define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; # elif (ACC_CC_MSC && (_MSC_VER < 900)) # define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; # else -# define ACC_COMPILE_TIME_ASSERT(e) ACC_COMPILE_TIME_ASSERT_HEADER(e) +# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];} # endif #endif diff --git a/src/acc/acc_type.h b/src/acc/acc_type.h index 9cf9bb06..7c0108f4 100644 --- a/src/acc/acc_type.h +++ b/src/acc/acc_type.h @@ -143,10 +143,9 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; /* acc_int64l_t is int_least64_t in terminology */ #if !defined(acc_int64l_t) -#undef __ACC_PREFER___INT64 #if (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8) -# if (ACC_CC_BORLANDC) -# define __ACC_PREFER___INT64 1 +# if (ACC_CC_BORLANDC) && !defined(ACC_CONFIG_PREFER___INT64) +# define ACC_CONFIG_PREFER___INT64 1 # endif #endif #if (SIZEOF_INT >= 8) @@ -161,7 +160,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; # define ACC_INT64L_C(c) c##L # define ACC_UINT64L_C(c) c##UL # define SIZEOF_ACC_INT64L_T SIZEOF_LONG -#elif (SIZEOF_LONG_LONG >= 8 && SIZEOF_UNSIGNED_LONG_LONG >= 8) && !defined(__ACC_PREFER___INT64) +#elif (SIZEOF_LONG_LONG >= 8 && SIZEOF_UNSIGNED_LONG_LONG >= 8) && !defined(ACC_CONFIG_PREFER___INT64) # define acc_int64l_t acc_llong_t # define acc_uint64l_t acc_ullong_t # if (ACC_CC_BORLANDC)