diff --git a/src/acc/acc.h b/src/acc/acc.h index ae14ab14..c445dd4e 100644 --- a/src/acc/acc.h +++ b/src/acc/acc.h @@ -27,7 +27,7 @@ #ifndef __ACC_H_INCLUDED #define __ACC_H_INCLUDED 1 -#define ACC_VERSION 20031125L +#define ACC_VERSION 20031215L #if !defined(ACC_CONFIG_INCLUDE) # define ACC_CONFIG_INCLUDE(file) file diff --git a/src/acc/acc_auto.h b/src/acc/acc_auto.h index fc606300..3152eb67 100644 --- a/src/acc/acc_auto.h +++ b/src/acc/acc_auto.h @@ -169,7 +169,10 @@ # undef HAVE_SYS_STAT_H # undef HAVE_SYS_TIME_H # undef HAVE_SYS_TYPES_H -#elif defined(__PW32__) && defined(__GNUC__) +#elif (ACC_CC_PGI) && defined(__MINGW32__) +# undef HAVE_UTIME_H +# define HAVE_SYS_UTIME_H 1 +#elif (ACC_OS_WIN32 && ACC_CC_GNUC && defined(__PW32__)) #elif (ACC_CC_SYMANTECC) # undef HAVE_DIRENT_H /* opendir() not implemented in libc */ # undef HAVE_UNISTD_H /* not working */ @@ -268,7 +271,7 @@ #if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX) # define HAVE_STRCASECMP 1 # define HAVE_STRNCASECMP 1 -#elif (ACC_OS_WIN32 && defined(__PW32__) && defined(__GNUC__)) +#elif (ACC_OS_WIN32 && ACC_CC_GNUC && defined(__PW32__)) # define HAVE_STRCASECMP 1 # define HAVE_STRNCASECMP 1 #else @@ -385,7 +388,10 @@ # undef HAVE_STRFTIME # undef HAVE_UTIME # undef HAVE_VSNPRINTF -#elif defined(__PW32__) && defined(__GNUC__) +#elif (ACC_CC_PGI) && defined(__MINGW32__) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +#elif (ACC_OS_WIN32 && defined(__PW32__) && defined(__GNUC__)) # undef HAVE_SNPRINTF # undef HAVE_VSNPRINTF #elif (ACC_CC_SYMANTECC) @@ -501,6 +507,9 @@ #elif (ACC_ARCH_IA32 && (ACC_CC_INTELC && defined(__linux__))) # define SIZEOF_LONG_LONG 8 # define SIZEOF_UNSIGNED_LONG_LONG 8 +#elif (ACC_ARCH_IA32 && (ACC_CC_PGI)) +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_UNSIGNED_LONG_LONG 8 #elif (ACC_ARCH_IA32 && (ACC_CC_INTELC || ACC_CC_MSC)) # define SIZEOF___INT64 8 # define SIZEOF_UNSIGNED___INT64 8 diff --git a/src/acc/acc_cc.h b/src/acc/acc_cc.h index a3278262..12c21698 100644 --- a/src/acc/acc_cc.h +++ b/src/acc/acc_cc.h @@ -21,7 +21,11 @@ * ... */ -#if defined(__GNUC__) && defined(__VERSION__) +#if defined(__INTEL_COMPILER) +# define ACC_CC_INTELC 1 +# define ACC_INFO_CC "Intel C" +# define ACC_INFO_CCVER ACC_MACRO_EXPAND(__INTEL_COMPILER) +#elif defined(__GNUC__) && defined(__VERSION__) # if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) # define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) # elif defined(__GNUC_MINOR__) @@ -51,10 +55,6 @@ # define ACC_CC_IBMC 1 # define ACC_INFO_CC "IBM C" # define ACC_INFO_CCVER ACC_MACRO_EXPAND(__IBMC__) -#elif defined(__INTEL_COMPILER) -# define ACC_CC_INTELC 1 -# define ACC_INFO_CC "Intel C" -# define ACC_INFO_CCVER ACC_MACRO_EXPAND(__INTEL_COMPILER) #elif defined(__LCC__) # define ACC_CC_LCC 1 # define ACC_INFO_CC "lcc" @@ -72,6 +72,10 @@ # define ACC_CC_PACIFICC 1 # define ACC_INFO_CC "Pacific C" # define ACC_INFO_CCVER ACC_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define ACC_CC_PGI 1 +# define ACC_INFO_CC "Portland Group PGI C" +# define ACC_INFO_CCVER "unknown" #elif defined(__PUREC__) # define ACC_CC_PUREC 1 # define ACC_INFO_CC "Pure C" diff --git a/src/acc/acc_chk.ch b/src/acc/acc_chk.ch index f434ad2b..2f5a140e 100644 --- a/src/acc/acc_chk.ch +++ b/src/acc/acc_chk.ch @@ -366,9 +366,11 @@ #if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32) ACCCHK_ASSERT(sizeof(size_t) == 4) ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 4) #elif (ACC_OS_WIN64) ACCCHK_ASSERT(sizeof(size_t) == 8) ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 8) #endif diff --git a/src/acc/acc_cxx.h b/src/acc/acc_cxx.h index 8ad6dd57..a4c1e142 100644 --- a/src/acc/acc_cxx.h +++ b/src/acc/acc_cxx.h @@ -33,6 +33,8 @@ # define ACC_CXX_NOTHROW #elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND)) # define ACC_CXX_NOTHROW +#elif (ACC_CC_ZORTECHC) +# define ACC_CXX_NOTHROW #endif #if !defined(ACC_CXX_NOTHROW) @@ -93,6 +95,8 @@ # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 # elif (ACC_CC_MSC && (_MSC_VER >= 1200)) # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# elif (ACC_CC_PGI) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 # endif #endif @@ -121,6 +125,7 @@ # define ACC_CXX_DISABLE_NEW_DELETE private: #endif + #if !defined(ACC_CXX_DISABLE_NEW_DELETE) && !(__ACC_CXX_HAVE_ARRAY_NEW) /* for old compilers use `protected' instead of `private' */ # define ACC_CXX_DISABLE_NEW_DELETE \ diff --git a/src/acc/acc_defs.h b/src/acc/acc_defs.h index d9cbb79d..ff8b4361 100644 --- a/src/acc/acc_defs.h +++ b/src/acc/acc_defs.h @@ -137,6 +137,8 @@ # define acc_alignof(e) __alignof__(e) #elif (ACC_CC_MSC && (_MSC_VER >= 1300)) # define acc_alignof(e) __alignof(e) +#elif (ACC_CC_PGI) +# define acc_alignof(e) __alignof__(e) #endif #if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295)) @@ -152,6 +154,8 @@ # define acc_inline __inline #elif (ACC_CC_MSC && (_MSC_VER >= 1000)) # define acc_inline __inline +#elif (ACC_CC_PGI) +# define acc_inline __inline__ #endif diff --git a/src/acc/acc_inci.h b/src/acc/acc_inci.h index 32033015..7aaac806 100644 --- a/src/acc/acc_inci.h +++ b/src/acc/acc_inci.h @@ -25,9 +25,9 @@ # include #elif (ACC_OS_WIN32 || ACC_OS_WIN64 || ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__))) # if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000)) -# elif defined(__PW32__) && defined(__GNUC__) +# elif (ACC_OS_WIN32 && ACC_CC_GNUC && defined(__PW32__)) /* ancient pw32 version */ -# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC < 0x025f00ul)) +# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul))) /* ancient cygwin/mingw version */ # else # if 1 && !defined(WIN32_LEAN_AND_MEAN) diff --git a/src/acc/acc_init.h b/src/acc/acc_init.h index 30d86f96..0839c321 100644 --- a/src/acc/acc_init.h +++ b/src/acc/acc_init.h @@ -141,6 +141,13 @@ # if !defined(__pascal) # define __pascal _pascal # endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif # endif # undef __ACC_RENAME_A # undef __ACC_RENAME_B @@ -148,15 +155,9 @@ #if (UINT_MAX == ACC_0xffffL) -#if defined(__MSDOS__) && defined(__TURBOC__) -# if (__TURBOC__ < 0x0150) -# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 -# define ACC_BROKEN_INTEGRAL_PROMOTION 1 -# endif -# if (__TURBOC__ < 0x0200) -# define ACC_BROKEN_SIZEOF 1 -# endif -#elif defined(MSDOS) && defined(_MSC_VER) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) # if (_MSC_VER < 600) # define ACC_BROKEN_INTEGRAL_CONSTANTS 1 # endif @@ -166,7 +167,20 @@ # endif #elif defined(__PACIFIC__) && defined(DOS) # define ACC_BROKEN_INTEGRAL_CONSTANTS 1 -#elif defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__)) +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 +# define ACC_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define ACC_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 # define ACC_BROKEN_SIZEOF 1 #endif #endif diff --git a/src/acc/acc_lib.h b/src/acc/acc_lib.h index 6994e9fb..c47ff1e3 100644 --- a/src/acc/acc_lib.h +++ b/src/acc/acc_lib.h @@ -378,7 +378,7 @@ typedef struct { char** go_argv; const char* go_shortopts; const acc_getopt_longopt_p longopts; -#if (ACC_CC_AZTECC || ACC_CC_TURBOC) +#if (ACC_BROKEN_CDECL_ALT_SYNTAX) int __acc_cdecl_va (*go_error)(const char *, ...); #else int (__acc_cdecl_va *go_error)(const char *, ...); diff --git a/src/acc/acc_type.h b/src/acc/acc_type.h index 7c0108f4..62d2567e 100644 --- a/src/acc/acc_type.h +++ b/src/acc/acc_type.h @@ -305,7 +305,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; # define __acc_cdecl_va __acc_cdecl #endif -#if (ACC_CC_AZTECC || ACC_CC_TURBOC) +#if (ACC_BROKEN_CDECL_ALT_SYNTAX) typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(int); #elif defined(RETSIGTYPE) typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(int); diff --git a/src/acc/acclib/misc.ch b/src/acc/acclib/misc.ch index 4bae3ee5..d4e9563d 100644 --- a/src/acc/acclib/misc.ch +++ b/src/acc/acclib/misc.ch @@ -31,7 +31,7 @@ ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd) return get_osfhandle(fd); #elif (ACC_OS_EMX && defined(__RSXNT__)) return -1; /* FIXME */ -#elif (ACC_OS_WIN32 && defined(__PW32__) && defined(__GNUC__)) +#elif (ACC_OS_WIN32 && ACC_CC_GNUC && defined(__PW32__)) return -1; /* FIXME */ #elif (ACC_OS_WIN32 || ACC_OS_WIN64) # if (ACC_CC_WATCOMC && (__WATCOMC__ < 1100)) diff --git a/src/acc/acclib/uclock.ch b/src/acc/acclib/uclock.ch index dbcf8d97..5c83036f 100644 --- a/src/acc/acclib/uclock.ch +++ b/src/acc/acclib/uclock.ch @@ -19,27 +19,41 @@ #endif -#if (ACC_H_WINDOWS_H) && defined(acc_int64l_t) - /* See also: KB Q274323: PRB: Performance Counter Value May - * Unexpectedly Leap Forward */ -# define __ACCLIB_UCLOCK_USE_QPC 1 -#endif - #if (ACC_OS_DOS16 || ACC_OS_WIN16) #elif (ACC_OS_DOS32 && defined(__DJGPP__)) -#elif (ACC_H_WINDOWS_H) && (ACC_OS_WIN32 || ACC_OS_WIN64) -# if (ACC_CC_DMC || ACC_CC_LCC) +#elif (ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_H_WINDOWS_H) +# if defined(acc_int64l_t) + /* See also: KB Q274323: PRB: Performance Counter Value May + * Unexpectedly Leap Forward */ +# define __ACCLIB_UCLOCK_USE_QPC 1 +# endif + /* fallbacks */ +# if ((ACC_CC_DMC && (__DMC__ < 0x838)) || ACC_CC_LCC) /* winmm.lib is missing */ # define __ACCLIB_UCLOCK_USE_CLOCK 1 # else -# define __ACCLIB_UCLOCK_USE_MMSYSTEM 1 +# define __ACCLIB_UCLOCK_USE_WINMM 1 # if (ACC_CC_MSC && (_MSC_VER >= 1000)) /* avoid -W4 warnings in */ # pragma warning(disable: 4201) # endif -# include -# if (ACC_CC_INTELC || ACC_CC_MSC) -# pragma comment(lib,"winmm") +# if 1 +# include +# else +# if (ACC_CC_INTELC || ACC_CC_MSC) + ACC_EXTERN_C __declspec(dllimport) unsigned long __stdcall timeGetTime(void); +# else + ACC_EXTERN_C unsigned long __stdcall timeGetTime(void); +# endif +# endif +# if (ACC_CC_DMC) +# pragma DMC includelib "winmm.lib" +# elif (ACC_CC_INTELC || ACC_CC_MSC) +# pragma comment(lib, "winmm") +# elif (ACC_CC_SYMANTECC) +# pragma SC includelib "winmm.lib" +# elif (ACC_CC_WATCOMC) +# pragma library("winmm.lib") # endif # endif #elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN32 || ACC_OS_WIN64) @@ -127,7 +141,7 @@ ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c) c->ticks.t64 = clock(); #elif (__ACCLIB_UCLOCK_USE_CLOCK) c->ticks.t32 = clock(); -#elif (__ACCLIB_UCLOCK_USE_MMSYSTEM) +#elif (__ACCLIB_UCLOCK_USE_WINMM) c->ticks.t32 = timeGetTime(); #elif (__ACCLIB_UCLOCK_USE_GETRUSAGE) struct rusage ru; @@ -175,7 +189,7 @@ ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_ #elif (__ACCLIB_UCLOCK_USE_CLOCK) h->mode = 5; d = (double) (stop->ticks.t32 - start->ticks.t32) / (CLOCKS_PER_SEC); -#elif (__ACCLIB_UCLOCK_USE_MMSYSTEM) +#elif (__ACCLIB_UCLOCK_USE_WINMM) h->mode = 6; d = (double) (stop->ticks.t32 - start->ticks.t32) / 1000.0; #elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)