diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-10-13 03:18:38 -0700 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-10-13 06:23:13 -0700 |
commit | 475091c67389ed61cf7589c9b7037fbd8c916b70 (patch) | |
tree | 9e7a8d3323b30a95896fdcc89249ebe2b69a480e /crawl-ref | |
parent | 18bf8b6c7b04fe232d240e6677f39de09d7a590f (diff) | |
download | crawl-ref-475091c67389ed61cf7589c9b7037fbd8c916b70.tar.gz crawl-ref-475091c67389ed61cf7589c9b7037fbd8c916b70.zip |
platform detection: clean up abuse of '_MSC_VER' macro
Use TARGET_COMPILER_VC instead, unless you need to find
the Visual C++ version information.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/chardump.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/database.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/debug.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/files.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/fixvec.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/hiscores.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/libw32c.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/maps.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/msvc.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/store.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/store.h | 2 |
13 files changed, 19 insertions, 19 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index bc686d06aa..7e420cb39a 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -15,7 +15,7 @@ REVISION("$Rev$"); #include <string.h> #include <fcntl.h> #include <stdlib.h> -#if !defined(__IBMCPP__) && !defined(_MSC_VER) +#if !defined(__IBMCPP__) && !defined(TARGET_COMPILER_VC) #include <unistd.h> #endif #include <ctype.h> diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index 1ae1224d46..7584109827 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -14,7 +14,7 @@ REVISION("$Rev$"); #include <stdlib.h> #include <cstdlib> #include <fstream> -#if !_MSC_VER +#ifndef TARGET_COMPILER_VC #include <unistd.h> #endif diff --git a/crawl-ref/source/debug.h b/crawl-ref/source/debug.h index 44571a1891..a147731d74 100644 --- a/crawl-ref/source/debug.h +++ b/crawl-ref/source/debug.h @@ -25,9 +25,11 @@ #endif // Synch with MSVC. +#ifdef TARGET_COMPILER_VC #if _MSC_VER >= 1100 && DEBUG != defined(_DEBUG) #error DEBUG and _DEBUG are out of sync! #endif +#endif #ifndef _lint diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 732f4fe497..1498cdfe14 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -2335,8 +2335,6 @@ private: extern game_options Options; -#if _MSC_VER -# include "msvc.h" -#endif +#include "msvc.h" #endif // EXTERNS_H diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 303ea417d6..8d4dceaf98 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -79,7 +79,7 @@ REVISION("$Rev$"); #include "tutorial.h" #include "view.h" -#if _MSC_VER +#ifdef TARGET_COMPILER_VC #include <direct.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -227,7 +227,7 @@ std::vector<std::string> get_dir_files(const std::string &dirname) { std::vector<std::string> files; -#ifdef _MSC_VER +#ifdef TARGET_COMPILER_VC WIN32_FIND_DATA lData; std::string dir = dirname; if (!dir.empty() && dir[dir.length() - 1] != FILE_SEPARATOR) @@ -387,7 +387,7 @@ bool file_exists(const std::string &name) // Low-tech existence check. bool dir_exists(const std::string &dir) { -#ifdef _MSC_VER +#ifdef TARGET_COMPILER_VC DWORD lAttr = GetFileAttributes(dir.c_str()); return (lAttr != INVALID_FILE_ATTRIBUTES && (lAttr & FILE_ATTRIBUTE_DIRECTORY)); @@ -411,7 +411,7 @@ static int _create_directory(const char *dir) return mkdir(dir, SHARED_FILES_CHMOD_PUBLIC | 0111); #elif defined(TARGET_OS_DOS) return mkdir(dir, 0755); -#elif defined(_MSC_VER) +#elif defined(TARGET_COMPILER_VC) return _mkdir(dir); #else return mkdir(dir); diff --git a/crawl-ref/source/fixvec.h b/crawl-ref/source/fixvec.h index b1f9c889a1..94ea8b5315 100644 --- a/crawl-ref/source/fixvec.h +++ b/crawl-ref/source/fixvec.h @@ -7,7 +7,7 @@ #ifndef FIXVEC_H #define FIXVEC_H -#if _MSC_VER +#ifdef TARGET_COMPILER_VC // Benign: FixedVector has an array in member init list # pragma warning(disable : 4351) #endif diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index 6df297a618..fbbe6f68ff 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -27,7 +27,7 @@ #include <ctype.h> #include <algorithm> #include <memory> -#if !_MSC_VER +#ifndef TARGET_COMPILER_VC #include <unistd.h> #endif diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 1c0c4d9b59..495c479903 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -1051,7 +1051,7 @@ int get_number_of_cols() return (screensize.X); } -#if _MSC_VER +#ifdef TARGET_COMPILER_VC struct DIR { public: @@ -1157,6 +1157,6 @@ int ftruncate(int fp, int size) return 0; } -#endif /* #if _MSC_VER */ +#endif /* #ifdef TARGET_COMPILER_VC */ #endif /* #if defined(WIN32CONSOLE) */ diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 15279c6917..eb28cb485c 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -14,7 +14,7 @@ REVISION("$Rev$"); #include <cstdlib> #include <algorithm> -#if !_MSC_VER +#ifndef TARGET_COMPILER_VC #include <unistd.h> #endif diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 4f0e6f1bf5..e1e726cbc6 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -13,7 +13,7 @@ REVISION("$Rev$"); #include <string.h> #include <algorithm> -#if !defined(__IBMCPP__) && !defined(_MSC_VER) +#if !defined(__IBMCPP__) && !defined(TARGET_COMPILER_VC) #include <unistd.h> #endif diff --git a/crawl-ref/source/msvc.h b/crawl-ref/source/msvc.h index be75c72fc8..29a08832f9 100644 --- a/crawl-ref/source/msvc.h +++ b/crawl-ref/source/msvc.h @@ -63,6 +63,6 @@ dirent* readdir(DIR*); int closedir(DIR*);
-#endif /* defined(_MSC_VER) */
+#endif /* defined(TARGET_COMPILER_VC) */ -#endif
\ No newline at end of file +#endif diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc index 8d74d75cca..39afd8927c 100644 --- a/crawl-ref/source/store.cc +++ b/crawl-ref/source/store.cc @@ -777,7 +777,7 @@ const CrawlStoreValue &CrawlStoreValue::operator ///////////////////// // Typecast operators -#if _MSC_VER +#ifdef TARGET_COMPILER_VC CrawlStoreValue::operator bool&() { return get_bool(); } CrawlStoreValue::operator char&() { return get_byte(); } CrawlStoreValue::operator short&() { return get_short(); } diff --git a/crawl-ref/source/store.h b/crawl-ref/source/store.h index d4aed1cd6b..7076b3812f 100644 --- a/crawl-ref/source/store.h +++ b/crawl-ref/source/store.h @@ -166,7 +166,7 @@ public: const CrawlStoreValue &operator [] (const vec_size &index) const; // Typecast operators -#if _MSC_VER +#ifdef TARGET_COMPILER_VC operator bool&(); operator char&(); operator short&(); |