*.rej
*.patch
*.diff
-
-testsuite
-qcvm
-gmqcc
-pak
+*.exe
distro/archlinux/*
distro/archbsd/*
if (!e) {
if (pos + 6 >= bufsize)
goto full;
- strncpy(buf + pos, "(null)", 6);
+ util_strncpy(buf + pos, "(null)", 6);
return pos + 6;
}
switch (e->expression.vtype) {
case TYPE_VARIANT:
- strncpy(buf + pos, "(variant)", 9);
+ util_strncpy(buf + pos, "(variant)", 9);
return pos + 9;
case TYPE_FIELD:
if (pos + 1 >= bufsize)
goto full;
buf[pos++] = '[';
- pos += snprintf(buf + pos, bufsize - pos - 1, "%i", (int)e->expression.count);
+ pos += util_snprintf(buf + pos, bufsize - pos - 1, "%i", (int)e->expression.count);
if (pos + 1 >= bufsize)
goto full;
buf[pos++] = ']';
typelen = strlen(typestr);
if (pos + typelen >= bufsize)
goto full;
- strncpy(buf + pos, typestr, typelen);
+ util_strncpy(buf + pos, typestr, typelen);
return pos + typelen;
}
namelen = strlen(self->name);
name = (char*)mem_a(namelen + 16);
- strncpy(name, self->name, namelen);
+ util_strncpy(name, self->name, namelen);
array->ir_values = (ir_value**)mem_a(sizeof(array->ir_values[0]) * array->expression.count);
array->ir_values[0] = v;
for (ai = 1; ai < array->expression.count; ++ai) {
- snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
+ util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
array->ir_values[ai] = ir_builder_create_field(ir, name, vtype);
if (!array->ir_values[ai]) {
mem_d(name);
namelen = strlen(self->name);
name = (char*)mem_a(namelen + 16);
- strncpy(name, self->name, namelen);
+ util_strncpy(name, self->name, namelen);
self->ir_values = (ir_value**)mem_a(sizeof(self->ir_values[0]) * self->expression.count);
self->ir_values[0] = v;
for (ai = 1; ai < self->expression.count; ++ai) {
- snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
+ util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
self->ir_values[ai] = ir_builder_create_global(ir, name, vtype);
if (!self->ir_values[ai]) {
mem_d(name);
namelen = strlen(self->name);
name = (char*)mem_a(namelen + 16);
- strncpy(name, self->name, namelen);
+ util_strncpy(name, self->name, namelen);
self->ir_values[0] = v;
for (ai = 1; ai < self->expression.count; ++ai) {
- snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
+ util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
self->ir_values[ai] = ir_function_create_local(func, name, vtype, param);
if (!self->ir_values[ai]) {
compile_error(ast_ctx(self), "internal_error: ir_builder_create_global failed on `%s`", name);
int wcolor;
int icolor;
- int state;
+ int state = 0;
/* attributes */
int intense = -1;
{
char data[4096];
memset(data, 0, sizeof(data));
+#ifdef _MSC_VER
+ vsnprintf_s(data, sizeof(data), sizeof(data), fmt, va);
+#else
vsnprintf(data, sizeof(data), fmt, va);
+#endif
ln = (GMQCC_IS_DEFINE(handle)) ? win_fputs(handle, data) : fs_file_puts(handle, data);
}
#endif
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
- printf(": %s\n", strerror(err));
+ printf(": %s\n", util_strerror(err));
}
static void qcvmerror(qc_program *prog, const char *fmt, ...)
qcany str;
CheckArgs(1);
num = GetArg(0);
- snprintf(buffer, sizeof(buffer), "%g", num->_float);
+ util_snprintf(buffer, sizeof(buffer), "%g", num->_float);
str.string = prog_tempstring(prog, buffer);
Return(str);
return 0;
qcany num;
CheckArgs(1);
str = GetArg(0);
- num._float = strtof(prog_getstring(prog, str->string), NULL);
+ num._float = (float)strtod(prog_getstring(prog, str->string), NULL);
Return(num);
return 0;
}
qcany str;
CheckArgs(1);
num = GetArg(0);
- snprintf(buffer, sizeof(buffer), "'%g %g %g'", num->vector[0], num->vector[1], num->vector[2]);
+ util_snprintf(buffer, sizeof(buffer), "'%g %g %g'", num->vector[0], num->vector[1], num->vector[2]);
str.string = prog_tempstring(prog, buffer);
Return(str);
return 0;
qcany str;
CheckArgs(1);
num = GetArg(0);
- snprintf(buffer, sizeof(buffer), "%i", num->_int);
+ util_snprintf(buffer, sizeof(buffer), "%i", num->_int);
str.string = prog_tempstring(prog, buffer);
Return(str);
return 0;
* at least I think so).
*/
#ifdef _MSC_VER
+#include <crtdbg.h> /* _CrtSetReportMode, _CRT_ASSERT */
/* {{{ */
/*
* Visual Studio has security CRT features which I actually want to support
if (!dir)
return NULL;
- strncpy(dir->dd_name, name, strlen(name));
+ util_strncpy(dir->dd_name, name, strlen(name));
return dir;
}
if (*dir->dd_name) {
size_t n = strlen(dir->dd_name);
if ((dirname = (char*)mem_a(n + 5) /* 4 + 1 */)) {
- strncpy(dirname, dir->dd_name, n);
- strncpy(dirname + n, "\\*.*", 4); /* 4 + 1 */
+ util_strncpy(dirname, dir->dd_name, n);
+ util_strncpy(dirname + n, "\\*.*", 4); /* 4 + 1 */
}
} else {
if (!(dirname = util_strdup("\\*.*")))
return NULL;
if ((data = (struct dirent*)mem_a(sizeof(struct dirent)))) {
- strncpy(data->d_name, info.cFileName, FILENAME_MAX - 1);
+ util_strncpy(data->d_name, info.cFileName, FILENAME_MAX - 1);
data->d_name[FILENAME_MAX - 1] = '\0'; /* terminate */
data->d_namlen = strlen(data->d_name);
}
int fs_dir_make(const char *path) {
return !CreateDirectory(path, NULL);
}
-
- /*
- * Visual studio also lacks S_ISDIR for sys/stat.h, so we emulate this as well
- * which is not hard at all.
- */
-# undef S_ISDIR
-# define S_ISDIR(X) ((X)&_S_IFDIR)
#else
# if !defined(__MINGW32__)
# include <sys/stat.h> /* mkdir */
/* __DATE__ */
char *ftepp_predef_date(lex_file *context) {
- struct tm *itime;
+ struct tm *itime = NULL;
time_t rtime;
char *value = (char*)mem_a(82);
/* 82 is enough for strftime but we also have " " in our string */
/* get time */
time (&rtime);
+
+#ifdef _MSC_VER
+ localtime_s(itime, &rtime);
+#else
itime = localtime(&rtime);
+#endif
strftime(value, 82, "\"%b %d %Y\"", itime);
/* __TIME__ */
char *ftepp_predef_time(lex_file *context) {
- struct tm *itime;
+ struct tm *itime = NULL;
time_t rtime;
char *value = (char*)mem_a(82);
/* 82 is enough for strftime but we also have " " in our string */
/* get time */
time (&rtime);
+
+#ifdef _MSC_VER
+ localtime_s(itime, &rtime);
+#else
itime = localtime(&rtime);
+#endif
strftime(value, 82, "\"%X\"", itime);
char *ftepp_predef_file(lex_file *context) {
size_t length = strlen(context->name) + 3; /* two quotes and a terminator */
char *value = (char*)mem_a(length);
- snprintf(value, length, "\"%s\"", context->name);
+ util_snprintf(value, length, "\"%s\"", context->name);
return value;
}
if (resetline && !ftepp->in_macro) {
char lineno[128];
- snprintf(lineno, 128, "\n#pragma line(%lu)\n", (unsigned long)(old_lexer->sline));
+ util_snprintf(lineno, 128, "\n#pragma line(%lu)\n", (unsigned long)(old_lexer->sline));
ftepp_out(ftepp, lineno, false);
}
ftepp_out(ftepp, "\n#pragma file(", false);
ftepp_out(ftepp, ctx.file, false);
- snprintf(lineno, sizeof(lineno), ")\n#pragma line(%lu)\n", (unsigned long)(ctx.line+1));
+ util_snprintf(lineno, sizeof(lineno), ")\n#pragma line(%lu)\n", (unsigned long)(ctx.line+1));
ftepp_out(ftepp, lineno, false);
/* skip the line */
minor[2] = '"';
} else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_GMQCC) {
ftepp_add_define(ftepp, NULL, "__STD_GMQCC__");
- snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
- snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
+ util_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
+ util_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
} else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCCX) {
ftepp_add_define(ftepp, NULL, "__STD_QCCX__");
- snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
- snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
+ util_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
+ util_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
} else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCC) {
ftepp_add_define(ftepp, NULL, "__STD_QCC__");
/* 1.0 */
*/
#ifdef _MSC_VER
# pragma warning(disable : 4244 ) /* conversion from 'int' to 'float', possible loss of data */
-# pragma warning(disable : 4018 ) /* signed/unsigned mismatch */
#endif /*! _MSC_VER */
#define GMQCC_VERSION_MAJOR 0
typedef __int64 int64_t;
#endif /*! _MSC_VER */
-/*
- *windows makes these prefixed because they're C99
- * TODO: utility versions that are type-safe and not
- * just plain textual subsitution.
- */
-#ifdef _MSC_VER
-# define snprintf(X, Y, Z, ...) _snprintf(X, Y, Z, __VA_ARGS__)
- /* strtof doesn't exist -> strtod does though :) */
-# define strtof(X, Y) (float)(strtod(X, Y))
-#endif /*! _MSC_VER */
-
/*
* Very roboust way at determining endianess at compile time: this handles
* almost every possible situation. Otherwise a runtime check has to be
unsigned short d_reclen;
unsigned short d_namlen;
char d_name[FILENAME_MAX];
- }
+ };
typedef struct {
struct _finddata_t dd_dta;
int dd_stat;
char dd_name[1];
} DIR;
+ /*
+ * Visual studio also lacks S_ISDIR for sys/stat.h, so we emulate this as well
+ * which is not hard at all.
+ */
+# ifdef S_ISDIR
+# undef S_ISDIR
+# endif /*! S_ISDIR */
+# define S_ISDIR(X) ((X)&_S_IFDIR)
#else
# include <dirent.h>
#endif /*! _WIN32 && !defined(__MINGW32__) */
void util_seed(uint32_t);
uint32_t util_rand();
-int util_vasprintf(char **ret, const char *fmt, va_list);
-int util_asprintf (char **ret, const char *fmt, ...);
+/*
+ * String functions (formatting, copying, concatenating, errors). These are wrapped
+ * to use the MSVC _safe_ versions when using MSVC, plus some implementations of
+ * these are non-conformant or don't exist such as asprintf and snprintf, which are
+ * not supported in C90, but do exist in C99.
+ */
+int util_vasprintf(char **ret, const char *fmt, va_list);
+int util_asprintf (char **ret, const char *fmt, ...);
+int util_snprintf (char *src, size_t bytes, const char *format, ...);
+char *util_strcat (char *dest, const char *src);
+char *util_strncpy (char *dest, const char *src, size_t num);
+const char *util_strerror (int num);
#ifdef NOTRACK
ir_value *global;
char name[128];
- snprintf(name, sizeof(name), "EXTPARM#%i", (int)(vec_size(ir->extparam_protos)));
+ util_snprintf(name, sizeof(name), "EXTPARM#%i", (int)(vec_size(ir->extparam_protos)));
global = ir_value_var(name, store_global, TYPE_VECTOR);
vec_push(ir->extparam_protos, global);
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qcvm", "qcvm.vcxproj", "{8DC505A6-6047-4683-BA81-BC4B7A839352}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmqcc", "gmqcc.vcxproj", "{0F0B0779-1A2F-43E9-B833-18C443F7229E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite.vcxproj", "{3F8F0021-66B8-43ED-906C-1CFE204E5673}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8DC505A6-6047-4683-BA81-BC4B7A839352}.Release|Win32.ActiveCfg = Release|Win32
- {8DC505A6-6047-4683-BA81-BC4B7A839352}.Release|Win32.Build.0 = Release|Win32
- {0F0B0779-1A2F-43E9-B833-18C443F7229E}.Release|Win32.ActiveCfg = Release|Win32
- {0F0B0779-1A2F-43E9-B833-18C443F7229E}.Release|Win32.Build.0 = Release|Win32
- {3F8F0021-66B8-43ED-906C-1CFE204E5673}.Release|Win32.ActiveCfg = Release|Win32
- {3F8F0021-66B8-43ED-906C-1CFE204E5673}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual Studio 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmqcc", "gmqcc\gmqcc.vcxproj", "{A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qcvm", "qcvm\qcvm.vcxproj", "{DC980E20-C7A8-4112-A517-631DBDA788E7}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pak", "pak\pak.vcxproj", "{A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcxproj", "{7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Win32 = Debug|Win32\r
+ Release|Win32 = Release|Win32\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}.Debug|Win32.Build.0 = Debug|Win32\r
+ {A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}.Release|Win32.ActiveCfg = Release|Win32\r
+ {A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}.Release|Win32.Build.0 = Release|Win32\r
+ {DC980E20-C7A8-4112-A517-631DBDA788E7}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {DC980E20-C7A8-4112-A517-631DBDA788E7}.Debug|Win32.Build.0 = Debug|Win32\r
+ {DC980E20-C7A8-4112-A517-631DBDA788E7}.Release|Win32.ActiveCfg = Release|Win32\r
+ {DC980E20-C7A8-4112-A517-631DBDA788E7}.Release|Win32.Build.0 = Release|Win32\r
+ {A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}.Debug|Win32.Build.0 = Debug|Win32\r
+ {A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}.Release|Win32.ActiveCfg = Release|Win32\r
+ {A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}.Release|Win32.Build.0 = Release|Win32\r
+ {7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}.Debug|Win32.Build.0 = Debug|Win32\r
+ {7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}.Release|Win32.ActiveCfg = Release|Win32\r
+ {7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}.Release|Win32.Build.0 = Release|Win32\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{0F0B0779-1A2F-43E9-B833-18C443F7229E}</ProjectGuid>
- <RootNamespace>gmqcc</RootNamespace>
- <TrackFileAccess>false</TrackFileAccess>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <EmbedManifest>false</EmbedManifest>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- </Link>
- <PostBuildEvent>
- <Command>Del /Q "$(IntDir)\*.tlog"</Command>
- </PostBuildEvent>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\ast.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\code.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\conout.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)conout_gmqcc.o</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\ftepp.c" />
- <ClCompile Include="..\ir.c" />
- <ClCompile Include="..\lexer.c" />
- <ClCompile Include="..\main.c" />
- <ClCompile Include="..\opts.c" />
- <ClCompile Include="..\parser.c" />
- <ClCompile Include="..\util.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)util_gmqcc.o</ObjectFileName>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\ast.h" />
- <ClInclude Include="..\gmqcc.h" />
- <ClInclude Include="..\ir.h" />
- <ClInclude Include="..\lexer.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}</ProjectGuid>\r
+ <RootNamespace>gmqcc</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>true</UseDebugLibraries>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>false</UseDebugLibraries>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup />\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>Disabled</Optimization>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\ast.c" />\r
+ <ClCompile Include="..\..\code.c" />\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\correct.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\ftepp.c" />\r
+ <ClCompile Include="..\..\ir.c" />\r
+ <ClCompile Include="..\..\lexer.c" />\r
+ <ClCompile Include="..\..\main.c" />\r
+ <ClCompile Include="..\..\opts.c" />\r
+ <ClCompile Include="..\..\parser.c" />\r
+ <ClCompile Include="..\..\utf8.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\ast.h" />\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ <ClInclude Include="..\..\intrin.h" />\r
+ <ClInclude Include="..\..\ir.h" />\r
+ <ClInclude Include="..\..\lexer.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\ast.c" />\r
+ <ClCompile Include="..\..\code.c" />\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\correct.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\ftepp.c" />\r
+ <ClCompile Include="..\..\ir.c" />\r
+ <ClCompile Include="..\..\lexer.c" />\r
+ <ClCompile Include="..\..\main.c" />\r
+ <ClCompile Include="..\..\opts.c" />\r
+ <ClCompile Include="..\..\parser.c" />\r
+ <ClCompile Include="..\..\utf8.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\ast.h" />\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ <ClInclude Include="..\..\intrin.h" />\r
+ <ClInclude Include="..\..\ir.h" />\r
+ <ClInclude Include="..\..\lexer.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}</ProjectGuid>\r
+ <RootNamespace>pak</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>true</UseDebugLibraries>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>false</UseDebugLibraries>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup />\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>Disabled</Optimization>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\opts.c" />\r
+ <ClCompile Include="..\..\pak.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\opts.c" />\r
+ <ClCompile Include="..\..\pak.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{8DC505A6-6047-4683-BA81-BC4B7A839352}</ProjectGuid>
- <RootNamespace>qcvm</RootNamespace>
- <TrackFileAccess>false</TrackFileAccess>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Full</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
- <PreprocessorDefinitions>QCVM_EXECUTOR=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- <PostBuildEvent>
- <Command>Del /Q "$(IntDir)\*.tlog"</Command>
- </PostBuildEvent>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\conout.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)conout_qcvm.o</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\exec.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\util.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)util_qcvm.o</ObjectFileName>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\gmqcc.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{DC980E20-C7A8-4112-A517-631DBDA788E7}</ProjectGuid>\r
+ <RootNamespace>qcvm</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>true</UseDebugLibraries>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>false</UseDebugLibraries>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup />\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>Disabled</Optimization>\r
+ <PreprocessorDefinitions>QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <PreprocessorDefinitions>QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\exec.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\exec.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{3F8F0021-66B8-43ED-906C-1CFE204E5673}</ProjectGuid>
- <RootNamespace>testsuite</RootNamespace>
- <TrackFileAccess>false</TrackFileAccess>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- <PostBuildEvent>
- <Command>Del /Q "$(IntDir)\*.tlog"</Command>
- </PostBuildEvent>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\conout.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)conout_testsuite.o</ObjectFileName>
- </ClCompile>
- <ClCompile Include="..\test.c" />
- <ClCompile Include="..\util.c">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)util_testsuite.o</ObjectFileName>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\gmqcc.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}</ProjectGuid>\r
+ <RootNamespace>testsuite</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>true</UseDebugLibraries>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <UseDebugLibraries>false</UseDebugLibraries>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup />\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>Disabled</Optimization>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\test.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\test.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
/* section found */
if (*(parse_end = opts_ini_next(parse_beg + 1, ']')) == ']') {
* parse_end = '\0'; /* terminate bro */
- strncpy(section_data, parse_beg + 1, sizeof(section_data));
+ util_strncpy(section_data, parse_beg + 1, sizeof(section_data));
section_data[sizeof(section_data) - 1] = '\0';
*oldname_data = '\0';
} else if (!error) {
opts_ini_rstrip(read_value);
/* valid name value pair, lets call down to handler */
- strncpy(oldname_data, read_name, sizeof(oldname_data));
+ util_strncpy(oldname_data, read_name, sizeof(oldname_data));
oldname_data[sizeof(oldname_data) - 1] ='\0';
if ((*errorhandle = loadhandle(section_data, read_name, read_value)) && !error)
memset(pathsplit, 0, 56);
- strncpy(directory, entry, 56);
+ util_strncpy(directory, entry, 56);
for (itr = 0; (token = pak_tree_sep(&directory, "/")) != NULL; itr++) {
elements[itr] = token;
}
for (jtr = 0; jtr < itr - 1; jtr++) {
- strcat(pathsplit, elements[jtr]);
- strcat(pathsplit, "/");
+ util_strcat(pathsplit, elements[jtr]);
+ util_strcat(pathsplit, "/");
if (fs_dir_make(pathsplit)) {
mem_d(pathsplit);
return false;
}
- strncpy(dir.name, file, strlen(file));
+ util_strncpy(dir.name, file, strlen(file));
/*
* Allocate some memory for loading in the data that will be
if ( (out = (ast_value*)util_htgeth(parser->ht_imm_string, str, hash)) ) {
if (dotranslate && out->name[0] == '#') {
char name[32];
- snprintf(name, sizeof(name), "dotranslate_%lu", (unsigned long)(parser->translated++));
+ util_snprintf(name, sizeof(name), "dotranslate_%lu", (unsigned long)(parser->translated++));
ast_value_set_name(out, name);
}
return out;
*/
if (dotranslate) {
char name[32];
- snprintf(name, sizeof(name), "dotranslate_%lu", (unsigned long)(parser->translated++));
+ util_snprintf(name, sizeof(name), "dotranslate_%lu", (unsigned long)(parser->translated++));
out = ast_value_new(parser_ctx(parser), name, TYPE_STRING);
} else
out = ast_value_new(parser_ctx(parser), "#IMMEDIATE", TYPE_STRING);
varargs->expression.flags |= AST_FLAG_IS_VARARG;
varargs->expression.next = (ast_expression*)ast_value_new(ast_ctx(var), NULL, TYPE_VECTOR);
varargs->expression.count = 0;
- snprintf(name, sizeof(name), "%s##va##SET", var->name);
+ util_snprintf(name, sizeof(name), "%s##va##SET", var->name);
if (!parser_create_array_setter_proto(parser, varargs, name)) {
ast_delete(varargs);
ast_block_delete(block);
goto enderrfn;
}
- snprintf(name, sizeof(name), "%s##va##GET", var->name);
+ util_snprintf(name, sizeof(name), "%s##va##GET", var->name);
if (!parser_create_array_getter_proto(parser, varargs, varargs->expression.next, name)) {
ast_delete(varargs);
ast_block_delete(block);
*/
if (var->expression.vtype == TYPE_ARRAY) {
char name[1024];
- snprintf(name, sizeof(name), "%s##SET", var->name);
+ util_snprintf(name, sizeof(name), "%s##SET", var->name);
if (!parser_create_array_setter(parser, var, name))
goto cleanup;
- snprintf(name, sizeof(name), "%s##GET", var->name);
+ util_snprintf(name, sizeof(name), "%s##GET", var->name);
if (!parser_create_array_getter(parser, var, var->expression.next, name))
goto cleanup;
}
goto cleanup;
}
- snprintf(name, sizeof(name), "%s##SETF", var->name);
+ util_snprintf(name, sizeof(name), "%s##SETF", var->name);
if (!parser_create_array_field_setter(parser, array, name))
goto cleanup;
telem = ast_type_copy(ast_ctx(var), array->expression.next);
tfield = ast_value_new(ast_ctx(var), "<.type>", TYPE_FIELD);
tfield->expression.next = telem;
- snprintf(name, sizeof(name), "%s##GETFP", var->name);
+ util_snprintf(name, sizeof(name), "%s##GETFP", var->name);
if (!parser_create_array_getter(parser, array, (ast_expression*)tfield, name)) {
ast_delete(tfield);
goto cleanup;
FILE *tempfile = NULL;
task_template_t *tmpl = NULL;
- snprintf(fullfile, sizeof(fullfile), "%s/%s", dir, file);
+ util_snprintf(fullfile, sizeof(fullfile), "%s/%s", dir, file);
tempfile = fs_file_open(fullfile, "r");
tmpl = (task_template_t*)mem_a(sizeof(task_template_t));
dir = fs_dir_open(curdir);
while ((files = fs_dir_read(dir))) {
- snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
+ util_snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
if (stat(buffer, &directory) == -1) {
con_err("internal error: stat failed, aborting\n");
* to test compile flags for all tests. This needs to be
* BEFORE other flags (so that the .tmpl can override them)
*/
+ #ifdef _MSC_VER
+ {
+ char buffer[4096];
+ size_t size;
+ getenv_s(&size, buffer, sizeof(buffer), "QCFLAGS");
+ qcflags = buffer;
+ }
+ #else
qcflags = getenv("QCFLAGS");
+ #endif
/*
* Generate the command required to open a pipe to a process
if (strcmp(tmpl->proceduretype, "-pp")) {
if (qcflags) {
if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
- snprintf(buf, sizeof(buf), "%s %s/%s %s %s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s %s -o %s",
task_bins[TASK_COMPILE],
curdir,
tmpl->sourcefile,
tmpl->tempfilename
);
} else {
- snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s %s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s %s -o %s",
task_bins[TASK_COMPILE],
curdir,
defs,
}
} else {
if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
- snprintf(buf, sizeof(buf), "%s %s/%s %s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s -o %s",
task_bins[TASK_COMPILE],
curdir,
tmpl->sourcefile,
tmpl->tempfilename
);
} else {
- snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s -o %s",
task_bins[TASK_COMPILE],
curdir,
defs,
} else {
/* Preprocessing (qcflags mean shit all here we don't allow them) */
if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
- snprintf(buf, sizeof(buf), "%s -E %s/%s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s -o %s",
task_bins[TASK_COMPILE],
curdir,
tmpl->sourcefile,
tmpl->tempfilename
);
} else {
- snprintf(buf, sizeof(buf), "%s -E %s/%s %s/%s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s %s/%s -o %s",
task_bins[TASK_COMPILE],
curdir,
defs,
* Open up some file desciptors for logging the stdout/stderr
* to our own.
*/
- snprintf(buf, sizeof(buf), "%s.stdout", tmpl->tempfilename);
+ util_snprintf(buf, sizeof(buf), "%s.stdout", tmpl->tempfilename);
task.stdoutlogfile = util_strdup(buf);
if (!(task.stdoutlog = fs_file_open(buf, "w"))) {
con_err("error opening %s for stdout\n", buf);
continue;
}
- snprintf(buf, sizeof(buf), "%s.stderr", tmpl->tempfilename);
+ util_snprintf(buf, sizeof(buf), "%s.stderr", tmpl->tempfilename);
task.stderrlogfile = util_strdup(buf);
if (!(task.stderrlog = fs_file_open(buf, "w"))) {
con_err("error opening %s for stderr\n", buf);
strstr(files->d_name, ".stdout") ||
strstr(files->d_name, ".stderr"))
{
- snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
+ util_snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
if (remove(buffer))
con_err("error removing temporary file: %s\n", buffer);
else
*/
bool task_trymatch(task_template_t *tmpl, char ***line) {
bool success = true;
+ bool preprocessing = false;
FILE *execute;
char buffer[4096];
memset (buffer,0,sizeof(buffer));
* actually specified.
*/
if (!strcmp(tmpl->executeflags, "$null")) {
- snprintf(buffer, sizeof(buffer), "%s %s",
+ util_snprintf(buffer, sizeof(buffer), "%s %s",
task_bins[TASK_EXECUTE],
tmpl->tempfilename
);
} else {
- snprintf(buffer, sizeof(buffer), "%s %s %s",
+ util_snprintf(buffer, sizeof(buffer), "%s %s %s",
task_bins[TASK_EXECUTE],
tmpl->executeflags,
tmpl->tempfilename
*/
if (!(execute = fs_file_open(tmpl->tempfilename, "r")))
return false;
+
+ preprocessing = true;
}
/*
tmpl->description,
tmpl->rulesfile
);
- pclose(execute);
+ if (preprocessing)
+ fs_file_close(execute);
+ else
+ pclose(execute);
return false;
}
data = NULL;
}
- if (strcmp(tmpl->proceduretype, "-pp"))
+ if (!preprocessing)
pclose(execute);
else
fs_file_close(execute);
size_t i = 0;
size_t j = 0;
- snprintf(space[0], sizeof(space[0]), "%d", (int)vec_size(task_tasks));
+ util_snprintf(space[0], sizeof(space[0]), "%d", (int)vec_size(task_tasks));
for (; i < vec_size(task_tasks); i++) {
memset(space[1], 0, sizeof(space[1]));
- snprintf(space[1], sizeof(space[1]), "%d", (int)(i + 1));
+ util_snprintf(space[1], sizeof(space[1]), "%d", (int)(i + 1));
con_out("test #%u %*s", i + 1, strlen(space[0]) - strlen(space[1]), "");
* will return the required amount to allocate.
*/
#ifdef _MSC_VER
- char *str;
if ((len = _vscprintf(fmt, args)) < 0) {
*dat = NULL;
return -1;
}
- tmp = mem_a(len + 1);
- if ((ret = _vsnprintf(tmp, len+1, fmt, args)) != len) {
+ tmp = (char*)mem_a(len + 1);
+ if ((ret = _vsnprintf_s(tmp, len+1, len+1, fmt, args)) != len) {
mem_d(tmp);
*dat = NULL;
return -1;
return read;
}
+/*
+ * These are various re-implementations (wrapping the real ones) of
+ * string functions that MSVC consideres unsafe. We wrap these up and
+ * use the safe varations on MSVC.
+ */
+#ifdef _MSC_VER
+ static char **util_strerror_allocated() {
+ static char **data = NULL;
+ return data;
+ }
+
+ static void util_strerror_cleanup(void) {
+ size_t i;
+ char **data = util_strerror_allocated();
+ for (i = 0; i < vec_size(data); i++)
+ mem_d(data[i]);
+ vec_free(data);
+ }
+
+ const char *util_strerror(int num) {
+ char *allocated = NULL;
+ static bool install = false;
+ static size_t tries = 0;
+ char **vector = util_strerror_allocated();
+
+ /* try installing cleanup handler */
+ while (!install) {
+ if (tries == 32)
+ return "(unknown)";
+
+ install = !atexit(&util_strerror_cleanup);
+ tries ++;
+ }
+
+ allocated = (char*)mem_a(4096); /* A page must be enough */
+ strerror_s(allocated, 4096, num);
+
+ vec_push(vector, allocated);
+ return (const char *)allocated;
+ }
+
+ int util_snprintf(char *src, size_t bytes, const char *format, ...) {
+ int rt;
+ va_list va;
+ va_start(va, format);
+
+ rt = vsprintf_s(src, bytes, format, va);
+ va_end (va);
+
+ return rt;
+ }
+
+ char *util_strcat(char *dest, const char *src) {
+ strcat_s(dest, strlen(src), src);
+ return dest;
+ }
+
+ char *util_strncpy(char *dest, const char *src, size_t num) {
+ strncpy_s(dest, num, src, num);
+ return dest;
+ }
+#else
+ const char *util_strerror(int num) {
+ return strerror(num);
+ }
+
+ int util_snprintf(char *src, size_t bytes, const char *format, ...) {
+ int rt;
+ va_list va;
+ va_start(va, format);
+ rt = vsnprintf(src, bytes, format, va);
+ va_end (va);
+
+ return rt;
+ }
+
+ char *util_strcat(char *dest, const char *src) {
+ return strcat(dest, src);
+ }
+
+ char *util_strncpy(char *dest, const char *src, size_t num) {
+ return strncpy(dest, src, num);
+ }
+
+#endif /*! _MSC_VER */
+
/*
* Implementation of the Mersenne twister PRNG (pseudo random numer
* generator). Implementation of MT19937. Has a period of 2^19937-1