From 5db33691bede6529448b2c29c5568512d09041ed Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 30 Sep 2013 23:49:21 +0000 Subject: [PATCH] Do not define __VISUALC__ for Intel C++ compiler under Windows. This is confusing and makes it more difficult to test for the "real" MSVC, test for __INTELC__ explicitly wherever needed instead. Also document __INTELC__ in our list of compilers. Closes #15359. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/mainpages/const_cpp.h | 1 + include/wx/chartype.h | 2 +- include/wx/compiler.h | 8 +------- include/wx/filefn.h | 9 ++++----- include/wx/wxcrt.h | 2 +- include/wx/wxcrtbase.h | 2 +- src/common/filefn.cpp | 1 + 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index d995747c5d..8b827cf3a3 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -147,6 +147,7 @@ compiler used. @itemdef{__EVC4__, Embedded Visual C++ 4 (can be only used for building wxWinCE)} @itemdef{__GNUG__, Gnu C++ on any platform, see also wxCHECK_GCC_VERSION} @itemdef{__GNUWIN32__, Gnu-Win32 compiler, see also wxCHECK_W32API_VERSION} +@itemdef{__INTELC__, Intel C++ compiler} @itemdef{__MINGW32__, Either MinGW32 or MinGW-w64 in either 32 or 64 bits} @itemdef{__MINGW32_TOOLCHAIN, MinGW32 only (32 bits only right now)} @itemdef{__MINGW64__, MinGW-w64 in 64 bit builds} diff --git a/include/wx/chartype.h b/include/wx/chartype.h index 5217258d1b..fbc307deb0 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -90,7 +90,7 @@ /* -------------------------------------------------------------------------- */ /* VC++ and BC++ starting with 5.2 have TCHAR support */ -#ifdef __VISUALC__ +#if defined(__VISUALC__) || (defined(__WINDOWS__) && defined(__INTELC__)) #define wxHAVE_TCHAR_SUPPORT #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) #define wxHAVE_TCHAR_SUPPORT diff --git a/include/wx/compiler.h b/include/wx/compiler.h index a25eddc04c..abca4e185c 100644 --- a/include/wx/compiler.h +++ b/include/wx/compiler.h @@ -16,15 +16,9 @@ Compiler detection and related helpers. */ -/* - Notice that Intel compiler can be used as Microsoft Visual C++ add-on and - so we should define both __INTELC__ and __VISUALC__ for it. - */ #ifdef __INTEL_COMPILER # define __INTELC__ -#endif - -#if defined(_MSC_VER) +#elif defined(_MSC_VER) /* define another standard symbol for Microsoft Visual C++: the standard one (_MSC_VER) is also defined by some other compilers. diff --git a/include/wx/filefn.h b/include/wx/filefn.h index a5bcd7e3fc..48f30f8c0b 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -92,7 +92,7 @@ #endif #endif -#if defined(__VISUALC__) && !defined(__WXWINCE__) +#if (defined(__VISUALC__) && !defined(__WXWINCE__)) || (defined(__WINDOWS__) && defined (__INTELC__)) typedef _off_t off_t; #elif defined(__SYMANTEC__) typedef long off_t; @@ -187,7 +187,7 @@ enum wxPosixPermissions #define wxStructStat struct _stat #elif (defined(__WINDOWS__) || defined(__OS2__)) && \ ( \ - defined(__VISUALC__) || \ + (defined(__VISUALC__) || (defined(__WINDOWS__) && defined (__INTELC__))) || \ defined(__MINGW64__) || \ (defined(__MINGW32__) && !defined(__WINE__) && \ wxCHECK_W32API_VERSION(0, 5)) || \ @@ -201,10 +201,10 @@ enum wxPosixPermissions #undef wxHAS_HUGE_STDIO_FILES // detect compilers which have support for huge files - #if defined(__VISUALC__) + #if (defined(__VISUALC__) || (defined(__WINDOWS__) && defined (__INTELC__))) #define wxHAS_HUGE_FILES 1 #elif defined(__MINGW32__) || defined(__MINGW64__) - #define wxHAS_HUGE_FILES 1 + #define wxHAS_HUGE_FILES 1f #elif defined(_LARGE_FILES) #define wxHAS_HUGE_FILES 1 #endif @@ -476,7 +476,6 @@ enum wxPosixPermissions #define wxSeek lseek #define wxFsync fsync #define wxEof eof - #define wxCRT_MkDir mkdir #define wxCRT_RmDir rmdir diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index dd579364fa..8164b26f14 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -17,7 +17,7 @@ #ifndef __WX_SETUP_H__ // For non-configure builds assume vsscanf is available, if not Visual C or DMC -#if !defined (__VISUALC__) && !defined (__DMC__) +#if !defined (__VISUALC__) && !(defined(__WINDOWS__) && defined(__INTELC__)) && !defined (__DMC__) #define HAVE_VSSCANF 1 #endif #endif diff --git a/include/wx/wxcrtbase.h b/include/wx/wxcrtbase.h index 16f6499229..79e437850a 100644 --- a/include/wx/wxcrtbase.h +++ b/include/wx/wxcrtbase.h @@ -165,7 +165,7 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size ); /* Almost all compilers have strdup(), but VC++ and MinGW call it _strdup(). And it's not available in MinGW strict ANSI mode nor under Windows CE. */ -#if (defined(__VISUALC__) && __VISUALC__ >= 1400) +#if (defined(__VISUALC__) && __VISUALC__ >= 1400) || (defined(__VISUAC__) && defined (__INTELC__)) #define wxCRT_StrdupA _strdup #elif defined(__MINGW32__) #ifndef __WX_STRICT_ANSI_GCC__ diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 4b87feb7db..8d68fee7db 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1191,6 +1191,7 @@ wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite) bool wxRemoveFile(const wxString& file) { #if defined(__VISUALC__) \ + || (defined(__WINDOWS__) && defined(__INTELC__)) \ || defined(__BORLANDC__) \ || defined(__WATCOMC__) \ || defined(__DMC__) \ -- 2.45.2