]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - quakedef.h
bugfix for showtopspeed
[xonotic/darkplaces.git] / quakedef.h
index 2645945b0c74cb20627c0abe7946cadf5db5f5df..6dc94ef159eb20005bccdb46b9e4070a87b8cd25 100644 (file)
@@ -30,8 +30,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #if defined(__GNUC__) && (__GNUC__ > 2)
 #define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
+#define DP_FUNC_PURE      __attribute__ ((pure))
 #else
 #define DP_FUNC_PRINTF(n)
+#define DP_FUNC_PURE
 #endif
 
 #include <sys/types.h>
@@ -352,5 +354,12 @@ void Sys_Shared_Init(void);
 // debug protocol exploits.
 #define DEMOMSG_CLIENT_TO_SERVER 0x80000000
 
+// In Quake, any char in 0..32 counts as whitespace
+//#define ISWHITESPACE(ch) ((unsigned char) ch <= (unsigned char) ' ')
+#define ISWHITESPACE(ch) (!(ch) || (ch) == ' ' || (ch) == '\t' || (ch) == '\r' || (ch) == '\n')
+
+// This also includes extended characters, and ALL control chars
+#define ISWHITESPACEORCONTROL(ch) ((signed char) (ch) <= (signed char) ' ')
+
 #endif