Fixed Compile Errors

Next is linker errors due to the breaking changes in stdio.h in the last 7 years.
This commit is contained in:
Allen
2021-06-12 03:53:00 -04:00
parent 749bb19d15
commit 7bb91ae27e
5 changed files with 34 additions and 14 deletions

7
.gitignore vendored
View File

@@ -13,4 +13,9 @@ src/DMX_Remake/DMX_Remake/Release/DMX.exe.intermediate.manifest
*.user
src/DMX_Remake/Debug/DMX_Debug.exe
src/DMX_Remake/Release/DMX.exe
*.opensdf
*.opensdf
src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db-shm
src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db-wal
src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.opendb
src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db
src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db

View File

@@ -59,7 +59,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_MBCS;ALLEGRO_HAVE_STDINT_H;DMXDEBUG;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_MBCS;CURL_STATICLIB;DMXDEBUG;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<StructMemberAlignment>Default</StructMemberAlignment>
<BufferSecurityCheck>true</BufferSecurityCheck>
@@ -74,16 +74,26 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AddModuleNamesToAssembly>
</AddModuleNamesToAssembly>
<ImportLibrary>
</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>del $(ProjectDir)\debug\version.obj</Command>
<Message>touch the attract mode to update the __DATE__</Message>
</PreBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -92,7 +102,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StructMemberAlignment>Default</StructMemberAlignment>
<PreprocessorDefinitions>_MBCS;ALLEGRO_HAVE_STDINT_H;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_MBCS;CURL_STATICLIB;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>true</BufferSecurityCheck>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
@@ -100,12 +110,14 @@
<UndefineAllPreprocessorDefinitions>false</UndefineAllPreprocessorDefinitions>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<UseStandardPreprocessor>false</UseStandardPreprocessor>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
@@ -114,6 +126,9 @@
<Command>del $(ProjectDir)\release\versionManager.obj</Command>
<Message>touch the attract mode to update the __DATE__</Message>
</PreBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\headers\analyticsManager.h" />

View File

@@ -4,6 +4,11 @@
#ifndef _COMMONDMXH_H_
#define _COMMONDMXH_H_
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#include <string>
#pragma warning(disable : 4312)
#include "../lib/allegro/include/allegro.h" // allegro library
#include "../lib/allegro/include/winalleg.h"
@@ -14,11 +19,6 @@
#include "../lib/fmodapi375win/api/inc/fmod.h" // an audio library used for playing keysounds
#pragma warning(default : 4312)
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#include <string>
#define UTIME unsigned long int
#define UNUSED(var) (void)(var)

View File

@@ -257,7 +257,7 @@ void LightsManager::loadLampProgram(const char* filename)
else
{
struct LAMP_STEP lamp;
sscanf_s(temp, "%d, %d, %d, %d, %c", &lamp.timing, &lamp.group, &lamp.addDuration, &lamp.color, &lamp.option);
sscanf_s(temp, "%d, %d, %d, %d, %c", &lamp.timing, &lamp.group, &lamp.addDuration, &lamp.color, &lamp.option, sizeof(char));
lampProgram.push_back(lamp);
}

View File

@@ -341,8 +341,8 @@ int main()
FILE* tfp = NULL;
fopen_s(&tfp, "testchart.txt", "rt");
fscanf_s(tfp, "%d", &testChartSongID);
fscanf_s(tfp, " %c", &tempch[0]);
fscanf_s(tfp, "%c", &tempch[1]);
fscanf_s(tfp, " %c", &tempch[0], sizeof(char));
fscanf_s(tfp, "%c", &tempch[1], sizeof(char));
fclose(tfp);
if ( tempch[1] == 'm' )