diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-15 11:54:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-15 11:54:07 +0400 |
commit | a73d0d3e72940ecd0e3e60c8e4e858c7e00ff5e2 (patch) | |
tree | 554c462fa090dad417a0e0371a7647007c33b1ba /source/blender/blenlib/BLI_winstuff.h | |
parent | a8077c8222876bdc67cfbc9ae56b04a12c8657e9 (diff) |
code cleanup: dont include BLI_winstuff.h on non windows systems, also cleanup some defines/includes for windows.
Diffstat (limited to 'source/blender/blenlib/BLI_winstuff.h')
-rw-r--r-- | source/blender/blenlib/BLI_winstuff.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 821946727f2..33ca7d235fa 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -33,28 +33,30 @@ * \brief Compatibility-like things for windows. */ -#ifdef _WIN32 +#ifndef _WIN32 +# error "This include is for Windows only!" +#endif #ifndef FREE_WINDOWS -#pragma warning(once: 4761 4305 4244 4018) +# pragma warning(once: 4761 4305 4244 4018) #else -#ifdef WINVER -#undef WINVER -#endif +# ifdef WINVER +# undef WINVER +# endif /* Some stuff requires WINVER 0x500, but mingw's default is 0x400 */ -#define WINVER 0x0501 +# define WINVER 0x0501 #endif #define WIN32_LEAN_AND_MEAN #ifndef WIN32_SKIP_HKEY_PROTECTION -#undef HKEY -#define HKEY WIN32_HKEY // prevent competing definitions -#include <windows.h> -#undef HKEY +# undef HKEY +# define HKEY WIN32_HKEY // prevent competing definitions +# include <windows.h> +# undef HKEY #else -#include <windows.h> +# include <windows.h> #endif #undef near @@ -83,10 +85,10 @@ extern "C" { #define MAXPATHLEN MAX_PATH #ifndef S_ISREG -#define S_ISREG(x) (((x)&_S_IFREG) == _S_IFREG) +# define S_ISREG(x) (((x)&_S_IFREG) == _S_IFREG) #endif #ifndef S_ISDIR -#define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR) +# define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR) #endif /* defines for using ISO C++ conformant names */ @@ -98,21 +100,21 @@ typedef unsigned int mode_t; /* use functions that take a 64 bit offset for files larger than 4GB */ #ifndef FREE_WINDOWS -#include <stdio.h> -#define fseek(stream, offset, origin) _fseeki64(stream, offset, origin) -#define ftell(stream) _ftelli64(stream) -#define lseek(fd, offset, origin) _lseeki64(fd, offset, origin) -#define tell(fd) _telli64(fd) +# include <stdio.h> +# define fseek(stream, offset, origin) _fseeki64(stream, offset, origin) +# define ftell(stream) _ftelli64(stream) +# define lseek(fd, offset, origin) _lseeki64(fd, offset, origin) +# define tell(fd) _telli64(fd) #endif /* mingw using _SSIZE_T_ to declare ssize_t type */ #ifndef _SSIZE_T_ -#define _SSIZE_T_ +# define _SSIZE_T_ /* python uses HAVE_SSIZE_T */ -#ifndef HAVE_SSIZE_T -#define HAVE_SSIZE_T 1 +# ifndef HAVE_SSIZE_T +# define HAVE_SSIZE_T 1 typedef long ssize_t; -#endif +# endif #endif struct dirent { @@ -148,7 +150,5 @@ int BLI_getInstallationDir(char *str); } #endif -#endif /* _WIN32 */ - #endif /* __BLI_WINSTUFF_H__ */ |