mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-21 11:31:25 +00:00
updated q_stdinc.h from uhexen2.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@459 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
63e785d2e7
commit
3618c26dc1
1 changed files with 16 additions and 9 deletions
|
@ -2,9 +2,12 @@
|
||||||
q_stdinc.h
|
q_stdinc.h
|
||||||
includes the minimum necessary stdc headers,
|
includes the minimum necessary stdc headers,
|
||||||
defines common and / or missing types.
|
defines common and / or missing types.
|
||||||
|
NOTE: for net stuff use net_sys.h,
|
||||||
|
for byte order use q_endian.h,
|
||||||
|
for math stuff use mathlib.h.
|
||||||
|
|
||||||
Copyright (C) 1996-1997 Id Software, Inc.
|
Copyright (C) 1996-1997 Id Software, Inc.
|
||||||
Copyright (C) 2007-2008 O.Sezer <sezero@users.sourceforge.net>
|
Copyright (C) 2007-2011 O.Sezer <sezero@users.sourceforge.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -42,6 +45,8 @@
|
||||||
sizeof (float) == 4
|
sizeof (float) == 4
|
||||||
sizeof (long) == 4 / 8
|
sizeof (long) == 4 / 8
|
||||||
sizeof (pointer *) == 4 / 8
|
sizeof (pointer *) == 4 / 8
|
||||||
|
For this, we need stdint.h (or inttypes.h)
|
||||||
|
FIXME: On some platforms, only inttypes.h is available.
|
||||||
FIXME: Properly replace certain short and int usage
|
FIXME: Properly replace certain short and int usage
|
||||||
with int16_t and int32_t.
|
with int16_t and int32_t.
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +62,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !(defined(_WIN32) || defined(_WIN64))
|
#if !defined(_WIN32)
|
||||||
#include <strings.h> /* strcasecmp and strncasecmp */
|
#include <strings.h> /* strcasecmp and strncasecmp */
|
||||||
#endif /* ! PLATFORM_WINDOWS */
|
#endif /* ! PLATFORM_WINDOWS */
|
||||||
|
|
||||||
|
@ -117,17 +122,21 @@ typedef unsigned char byte;
|
||||||
#undef true
|
#undef true
|
||||||
#undef false
|
#undef false
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
/* do NOT use the bool of C++ because some structures have boolean and they
|
/* some structures have qboolean members and the x86 asm code expect
|
||||||
* expect it to be 4 bytes long. as a hack, typedef it as int. */
|
* those members to be 4 bytes long. therefore, qboolean must be 32
|
||||||
/* DO HOPE that the compiler built-ins for true and false are 1 and 0 ... */
|
* bits and it can NOT be binary compatible with the 8 bit C++ bool. */
|
||||||
typedef int qboolean;
|
typedef int qboolean;
|
||||||
|
COMPILE_TIME_ASSERT(falsehood, (0 == false));
|
||||||
|
COMPILE_TIME_ASSERT(truth, (1 == true));
|
||||||
#else
|
#else
|
||||||
typedef enum {
|
typedef enum {
|
||||||
false = 0,
|
false = 0,
|
||||||
true = 1
|
true = 1
|
||||||
} qboolean;
|
} qboolean;
|
||||||
|
COMPILE_TIME_ASSERT(falsehood, ((1 != 1) == false));
|
||||||
|
COMPILE_TIME_ASSERT(truth, ((1 == 1) == true));
|
||||||
#endif
|
#endif
|
||||||
|
COMPILE_TIME_ASSERT(qboolean, sizeof(qboolean) == 4);
|
||||||
|
|
||||||
/*==========================================================================*/
|
/*==========================================================================*/
|
||||||
|
|
||||||
|
@ -151,12 +160,10 @@ typedef int ssize_t;
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
/* compatibility with M$ types */
|
/* compatibility with M$ types */
|
||||||
#if !(defined(_WIN32) || defined(_WIN64))
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
#define PASCAL
|
#define PASCAL
|
||||||
#define FAR
|
#define FAR
|
||||||
#define APIENTRY
|
#define APIENTRY
|
||||||
|
|
||||||
#endif /* ! WINDOWS */
|
#endif /* ! WINDOWS */
|
||||||
|
|
||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
|
|
Loading…
Reference in a new issue