#include "gmqcc.h"
+opts_cmd_t opts; /* command line options */
static void loaderror(const char *fmt, ...)
{
int err = errno;
char *find;
char *value;
size_t size;
+#ifdef _MSC_VER
+ char buffer[64];
+#endif
if (stat(context->name, &finfo))
return util_strdup("\"<failed to determine timestamp>\"");
* ctime and its fucking annoying newline char, no worries, we're
* professionals here.
*/
+
+#ifndef _MSC_VER
find = ctime(&finfo.st_mtime);
+#else
+ ctime_s(buffer, sizeof(buffer), &finfo.st_mtime);
+ find = buffer;
+#endif
+
value = (char*)mem_a(strlen(find) + 1);
memcpy(&value[1], find, (size = strlen(find)) - 1);
#objects
OBJ_C = main.o lexer.o parser.o fs.o stat.o util.o code.o ast.o ir.o conout.o ftepp.o opts.o utf8.o correct.o fold.o intrin.o
OBJ_P = util.o fs.o conout.o opts.o pak.o stat.o
-OBJ_T = test.o util.o opts.o conout.o fs.o stat.o
+OBJ_T = test.o util.o conout.o fs.o stat.o
OBJ_X = exec-standalone.o util.o opts.o conout.o fs.o stat.o
#gource flags
vec_push(intrin->parser->globals, (ast_expression*)(VALUE)); \
} while (0)
-#define QC_M_E 2.71828182845905
+#define QC_M_E 2.71828182845905f
static ast_expression *intrin_pow (intrin_t *intrin) {
/*
<Platform>Win32</Platform>\r
</ProjectConfiguration>\r
</ItemGroup>\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="..\..\fold.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\ftepp.c" />\r
+ <ClCompile Include="..\..\intrin.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="..\..\stat.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="..\..\ir.h" />\r
+ <ClInclude Include="..\..\lexer.h" />\r
+ <ClInclude Include="..\..\parser.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{A6BD74E1-31BB-4D00-A9E0-09FF1BC76ED6}</ProjectGuid>\r
<RootNamespace>gmqcc</RootNamespace>\r
<ClCompile>\r
<WarningLevel>Level3</WarningLevel>\r
<Optimization>Disabled</Optimization>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<Optimization>MaxSpeed</Optimization>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\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
<ClCompile Include="..\..\code.c" />\r
<ClCompile Include="..\..\conout.c" />\r
<ClCompile Include="..\..\correct.c" />\r
+ <ClCompile Include="..\..\fold.c" />\r
<ClCompile Include="..\..\fs.c" />\r
<ClCompile Include="..\..\ftepp.c" />\r
+ <ClCompile Include="..\..\intrin.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="..\..\stat.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
+ <ClInclude Include="..\..\parser.h" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="..\..\opts.def" />\r
<Platform>Win32</Platform>\r
</ProjectConfiguration>\r
</ItemGroup>\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="..\..\stat.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{A6F66BE9-57EF-4E93-AA9D-6E0C8B0990AD}</ProjectGuid>\r
<RootNamespace>pak</RootNamespace>\r
<ClCompile>\r
<WarningLevel>Level3</WarningLevel>\r
<Optimization>Disabled</Optimization>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<Optimization>MaxSpeed</Optimization>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\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
<ClCompile Include="..\..\fs.c" />\r
<ClCompile Include="..\..\opts.c" />\r
<ClCompile Include="..\..\pak.c" />\r
+ <ClCompile Include="..\..\stat.c" />\r
<ClCompile Include="..\..\util.c" />\r
</ItemGroup>\r
<ItemGroup>\r
- <None Include="..\..\opts.def" />\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
</ItemGroup>\r
<ItemGroup>\r
- <ClInclude Include="..\..\gmqcc.h" />\r
+ <None Include="..\..\opts.def" />\r
</ItemGroup>\r
</Project>
\ No newline at end of file
<Platform>Win32</Platform>\r
</ProjectConfiguration>\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\exec.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\stat.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{DC980E20-C7A8-4112-A517-631DBDA788E7}</ProjectGuid>\r
<RootNamespace>qcvm</RootNamespace>\r
<ClCompile>\r
<WarningLevel>Level3</WarningLevel>\r
<Optimization>Disabled</Optimization>\r
- <PreprocessorDefinitions>QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>NVALGRIND;QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<Optimization>MaxSpeed</Optimization>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
- <PreprocessorDefinitions>QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <PreprocessorDefinitions>NVALGRIND;QCVM_EXECUTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\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
<ItemGroup>\r
<ClCompile Include="..\..\conout.c" />\r
<ClCompile Include="..\..\exec.c" />\r
- <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\stat.c" />\r
<ClCompile Include="..\..\util.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\gmqcc.h" />\r
<Platform>Win32</Platform>\r
</ProjectConfiguration>\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\conout.c" />\r
+ <ClCompile Include="..\..\fs.c" />\r
+ <ClCompile Include="..\..\opts.c" />\r
+ <ClCompile Include="..\..\stat.c" />\r
+ <ClCompile Include="..\..\test.c" />\r
+ <ClCompile Include="..\..\util.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\gmqcc.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{7E2839D9-9C1A-4489-9FF9-FDC854EBED3D}</ProjectGuid>\r
<RootNamespace>testsuite</RootNamespace>\r
<ClCompile>\r
<WarningLevel>Level3</WarningLevel>\r
<Optimization>Disabled</Optimization>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<Optimization>MaxSpeed</Optimization>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <PreprocessorDefinitions>NVALGRIND;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\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
<?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="..\..\stat.c" />\r
<ClCompile Include="..\..\test.c" />\r
<ClCompile Include="..\..\util.c" />\r
+ <ClCompile Include="..\..\conout.c" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\gmqcc.h" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="..\..\opts.def" />\r
+ </ItemGroup>\r
</Project>
\ No newline at end of file
};
unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
-opts_cmd_t opts; /* command lien options */
+opts_cmd_t opts; /* command line options */
static void opts_setdefault(void) {
memset(&opts, 0, sizeof(opts_cmd_t));
self_think = (ast_expression*)ast_entfield_new(ctx, gbl_self, fld_think);
time_plus_1 = (ast_expression*)ast_binary_new(ctx, INSTR_ADD_F,
- gbl_time, (ast_expression*)fold_constgen_float(parser->fold, 0.1));
+ gbl_time, (ast_expression*)fold_constgen_float(parser->fold, 0.1f));
if (!self_frame || !self_nextthink || !self_think || !time_plus_1) {
if (self_frame) ast_delete(self_frame);
uint32_t k;
uint32_t h = 0x1EF0 ^ len;
- for (i = -block; i; i++) {
+ for (i = -((int)block); i; i++) {
k = blocks[i];
k *= mask1;
k = GMQCC_ROTL32(k, 15);
char *cmd = NULL;
popen_t *open = (popen_t*)mem_a(sizeof(popen_t));
+#ifndef _MSC_VER
tmpnam(open->name_err);
tmpnam(open->name_out);
+#else
+ tmpnam_s(open->name_err, L_tmpnam);
+ tmpnam_s(open->name_out, L_tmpnam);
+#endif
(void)mode; /* excluded */
mem_d(open);
}
+# define popen _popen
+# define pclose _pclose
#endif /*! _WIN32 */
#define TASK_COMPILE 0