diff options
Diffstat (limited to 'crawl-ref/source/msvc.h')
-rw-r--r-- | crawl-ref/source/msvc.h | 133 |
1 files changed, 67 insertions, 66 deletions
diff --git a/crawl-ref/source/msvc.h b/crawl-ref/source/msvc.h index 29a08832f9..b929f53fc8 100644 --- a/crawl-ref/source/msvc.h +++ b/crawl-ref/source/msvc.h @@ -1,68 +1,69 @@ -/*
- * File: msvc.h
- * Summary: Header file for MSVC compiles
- * Written by: Paul Du Bois
- */
-
-#ifndef __msvc_h
-#define __msvc_h
-
-#if defined(TARGET_COMPILER_VC)
-
-#include <io.h>
-
-#define fileno _fileno
-#define itoa _itoa
-#define snprintf _snprintf
-#define strcasecmp _stricmp
-#define strdup _strdup
-#define stricmp _stricmp
-#define strlwr _strlwr
-#define strncasecmp _strnicmp
-#define strnicmp _strnicmp
-#define unlink _unlink
-#define ftruncate _chsize
-
-// No va_copy in MSVC
-#if !defined(va_copy)
-#define va_copy(dst, src) \
- ((void) memcpy(&(dst), &(src), sizeof(va_list)))
-#endif
-
-#pragma warning( disable : 4290 )
-#pragma warning( disable : 4351 )
-// bool -> int
-#pragma warning( disable : 4800 )
-
-// struct vs class XXX: fix these some day!
-#pragma warning( disable : 4099 )
-
-// truncating conversions XXX: fix these too!
-#pragma warning( disable : 4244 )
-
-
-// ----------------------------------------------------------------------
-// dirent.h replacement
-// ----------------------------------------------------------------------
-
-#define DT_DIR 4
-#define DT_REG 8
-
-struct DIR;
-struct dirent
-{
- // ino_t d_ino;
- unsigned short d_reclen;
- unsigned char d_type;
- unsigned short d_namlen;
- char d_name[255];
-};
-
-DIR* opendir(const char* path);
-dirent* readdir(DIR*);
-int closedir(DIR*);
-
-
+/* + * File: msvc.h + * Summary: Header file for MSVC compiles + * Written by: Paul Du Bois + */ + +#ifndef __msvc_h +#define __msvc_h + +#if defined(TARGET_COMPILER_VC) + +#include <io.h> + +#define fileno _fileno +#define itoa _itoa +#define snprintf _snprintf +#define strcasecmp _stricmp +#define strdup _strdup +#define stricmp _stricmp +#define strlwr _strlwr +#define strncasecmp _strnicmp +#define strnicmp _strnicmp +#define unlink _unlink +#define ftruncate _chsize +#define putenv _putenv + +// No va_copy in MSVC +#if !defined(va_copy) +#define va_copy(dst, src) \ + ((void) memcpy(&(dst), &(src), sizeof(va_list))) +#endif + +#pragma warning( disable : 4290 ) +#pragma warning( disable : 4351 ) +// bool -> int +#pragma warning( disable : 4800 ) + +// struct vs class XXX: fix these some day! +#pragma warning( disable : 4099 ) + +// truncating conversions XXX: fix these too! +#pragma warning( disable : 4244 ) + + +// ---------------------------------------------------------------------- +// dirent.h replacement +// ---------------------------------------------------------------------- + +#define DT_DIR 4 +#define DT_REG 8 + +struct DIR; +struct dirent +{ + // ino_t d_ino; + unsigned short d_reclen; + unsigned char d_type; + unsigned short d_namlen; + char d_name[255]; +}; + +DIR* opendir(const char* path); +dirent* readdir(DIR*); +int closedir(DIR*); + + #endif /* defined(TARGET_COMPILER_VC) */ -
+ #endif |