From d71843d2e48647fae51f6b577dd93a228e95832a Mon Sep 17 00:00:00 2001 From: Molgrum Date: Fri, 27 Jun 2008 19:16:15 +0000 Subject: [PATCH] Redefine snprintf for Windows. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3018 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- q3asm2/q3asm2.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/q3asm2/q3asm2.c b/q3asm2/q3asm2.c index 2a430f602..fb6a78732 100644 --- a/q3asm2/q3asm2.c +++ b/q3asm2/q3asm2.c @@ -166,6 +166,10 @@ enum segs { #define USEDATBLOCK 64 #define STACKSIZE 0x10000 +#ifdef WIN32 +#define snprintf _snprintf +#endif + struct usedat { struct usedat *next; int count; @@ -831,7 +835,7 @@ void AssembleFile(struct assembler *w, int fnum, char *filename) f = fopen(filename, "rt"); if (!f) { - _snprintf(linebuffer, sizeof(linebuffer)-1, "%s.asm", filename); + snprintf(linebuffer, sizeof(linebuffer)-1, "%s.asm", filename); f = fopen(linebuffer, "rt"); } @@ -1073,7 +1077,7 @@ int ParseCommandList(struct workload *w, int numcmds, char **cmds) if (!f) { char blah[256]; - _snprintf(blah, sizeof(blah)-1, "%s.q3asm", *cmds); + snprintf(blah, sizeof(blah)-1, "%s.q3asm", *cmds); f = fopen(blah, "rt"); } if (f) @@ -1143,7 +1147,7 @@ int ParseCommandList(struct workload *w, int numcmds, char **cmds) if (!strchr(*cmds, '.')) { - _snprintf(w->output, sizeof(w->output)-1, "%s.qvm", *cmds); + snprintf(w->output, sizeof(w->output)-1, "%s.qvm", *cmds); } else {