]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - quakedef.h
cmd: Re-re-re-re-implement the command parser. Allocate text only as needed.
[xonotic/darkplaces.git] / quakedef.h
index 0279913c5983653d5958f31e5c7098441312be3b..2d2b10f0064ac2054fe4eed95ee979f3e0f10472 100644 (file)
@@ -603,7 +603,7 @@ void Sys_Shared_Init(void);
 // 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')
-
+#define ISCOMMENT(ch, pos) ch[pos] == '/' && ch[pos + 1] == '/' && (pos == 0 || ISWHITESPACE(ch[pos - 1]))
 // This also includes extended characters, and ALL control chars
 #define ISWHITESPACEORCONTROL(ch) ((signed char) (ch) <= (signed char) ' ')