Skip to content

Commit

Permalink
predef.h: indentation of #if #else #endif; replaced #ifdef LINUX by #…
Browse files Browse the repository at this point in the history
…ifdef _GNU_SOURCE
  • Loading branch information
abique committed Jun 23, 2011
1 parent 4d1aa5d commit 1184d20
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions mordor/predef.h
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
#ifndef __MORDOR_PREDEF_H__
#define __MORDOR_PREDEF_H__
# define __MORDOR_PREDEF_H__

#include "version.h"
# include "version.h"

#ifdef WINDOWS
# ifdef WINDOWS
// Get Vista+ APIs
#define _WIN32_WINNT 0x0600
# define _WIN32_WINNT 0x0600
// Don't include tons of crap from windows.h
#define WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
// Define this so security.h works
#define SECURITY_WIN32
# define SECURITY_WIN32
// Shut up, CRT
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
# define _CRT_NONSTDC_NO_WARNINGS
# define _SCL_SECURE_NO_WARNINGS

// Use more common names for functions
// (cross-platform 64-bit, strip the underscores)
#define atoll _atoi64
#define strtoll _strtoi64
#define strtoull _strtoui64
#define strnicmp _strnicmp
#define mkdir _mkdir
#define snprintf _snprintf
# define atoll _atoi64
# define strtoll _strtoi64
# define strtoull _strtoui64
# define strnicmp _strnicmp
# define mkdir _mkdir
# define snprintf _snprintf

#include <ntstatus.h>
#define WIN32_NO_STATUS
#include <windows.h>
#include <ws2tcpip.h>
# include <ntstatus.h>
# define WIN32_NO_STATUS
# include <windows.h>
# include <ws2tcpip.h>

// Take things out of the preprocessor, and put into the global namespace
// From WinGDI.h: #define ERROR 0
#ifdef ERROR
#undef ERROR
# ifdef ERROR
# undef ERROR
enum {
ERROR = 0
};
#endif
# endif

// From WinNT.h: #define DELETE (0x00010000L)
#ifdef DELETE
#undef DELETE
# ifdef DELETE
# undef DELETE
enum {
DELETE = (0x00010000L)
};
#endif
# endif

#else
#ifdef LINUX
#include <sys/sysmacros.h>
# else // WINDOWS
# ifdef _GNU_SOURCE
# include <sys/sysmacros.h>

#ifdef major
#undef major
#endif
#ifdef minor
#undef minor
#endif
#endif
# ifdef major
# undef major
# endif
# ifdef minor
# undef minor
# endif
# endif

#define stricmp strcasecmp
#define strnicmp strncasecmp
# define stricmp strcasecmp
# define strnicmp strncasecmp

#endif
# endif // WINDOWS


#endif

0 comments on commit 1184d20

Please sign in to comment.