From: Dale Weiler Date: Wed, 16 Oct 2013 23:54:21 +0000 (-0400) Subject: Make it valid C++ code, such that it can compile as C++ code. X-Git-Tag: 0.3.5~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f53502c9ca9b78090712a424c1b87c27682be66c;p=xonotic%2Fgmqcc.git Make it valid C++ code, such that it can compile as C++ code. --- diff --git a/ansi.c b/ansi.c index 412e9a8..73792aa 100644 --- a/ansi.c +++ b/ansi.c @@ -52,7 +52,7 @@ const char *platform_tmpnam(char *str) { return tmpnam(str); } -const char *platform_getenv(char *var) { +const char *platform_getenv(const char *var) { return getenv(var); } diff --git a/msvc.c b/msvc.c index 2851cbf..77afc10 100644 --- a/msvc.c +++ b/msvc.c @@ -80,7 +80,7 @@ const char *platform_tmpnam(char *str) { return tmpnam_s(str, L_tmpnam); } -const char *platform_getenv(char *var) { +const char *platform_getenv(const char *var) { char *buffer = (char *)platform_mem_allocate(GETENV_BUFFER); size_t size; getenv_s(&size, buffer, GETENV_BUFFER, var); diff --git a/opts.c b/opts.c index 1d8fd73..23a0f4c 100644 --- a/opts.c +++ b/opts.c @@ -60,7 +60,7 @@ opts_cmd_t opts; /* command line options */ static void opts_setdefault(void) { memset(&opts, 0, sizeof(opts_cmd_t)); OPTS_OPTION_BOOL(OPTION_CORRECTION) = true; - OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src"; + OPTS_OPTION_STR(OPTION_PROGSRC) = (char*)"progs.src"; /* warnings */ opts_set(opts.warn, WARN_UNUSED_VARIABLE, true); diff --git a/platform.h b/platform.h index bb76568..50b119a 100644 --- a/platform.h +++ b/platform.h @@ -216,7 +216,7 @@ const char *platform_tmpnam(char *str); * pointer. The return value is *NULL* if `var` is not found in the * enviroment table. */ -const char *platform_getenv(char *var); +const char *platform_getenv(const char *var); /* * Function: platform_vasprintf