MS Visual Studio support:

* Quake/console.c, net_udp.c: replace snprintf by q_snprintf.
* Quake/common.h: Define q_snprintf as _snprintf for windows and as
snprintf for all others. Likewise for q_vsnprintf. Disable several
MSVC warnings. Define fmin and fmax as min and max macros for MSVC.
* Windows/quakespasm.vcproj, quakespasm.sln: Add Visual Studio 2005
project files.
* Windows/SDL_x64.zip: Add SDL x64 import libraries for MSVC.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@281 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-08-20 02:25:22 +00:00
parent 88f32bdabf
commit d8779f7d0d
6 changed files with 898 additions and 4 deletions

View file

@ -24,6 +24,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// comndef.h -- general definitions
#if defined(_WIN32)
#define q_snprintf _snprintf
#define q_vsnprintf _vsnprintf
#ifdef _MSC_VER
# pragma warning(disable:4244)
/* 'argument' : conversion from 'type1' to 'type2',
possible loss of data */
# pragma warning(disable:4305)
/* 'identifier' : truncation from 'type1' to 'type2' */
/* in our case, truncation from 'double' to 'float' */
# pragma warning(disable:4267)
/* 'var' : conversion from 'size_t' to 'type',
possible loss of data (/Wp64 warning) */
/* MSC doesn't have fmin() / fmax(), use the min/max macros: */
#define fmax max
#define fmin min
#endif /* _MSC_VER */
#else /* _WIN32 */
#define q_snprintf snprintf
#define q_vsnprintf vsnprintf
#endif /* _WIN32 */
typedef struct sizebuf_s
{

View file

@ -1256,7 +1256,7 @@ void LOG_Init (quakeparms_t *parms)
inittime = time (NULL);
strftime (session, sizeof(session), "%m/%d/%Y %H:%M:%S", localtime(&inittime));
snprintf (logfilename, sizeof(logfilename), "%s/qconsole.log", parms->basedir);
q_snprintf (logfilename, sizeof(logfilename), "%s/qconsole.log", parms->basedir);
unlink (logfilename);

View file

@ -334,9 +334,9 @@ char *UDP_AddrToString (struct qsockaddr *addr)
int haddr;
haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr);
snprintf (buffer, sizeof(buffer), "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff,
(haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff,
ntohs(((struct sockaddr_in *)addr)->sin_port));
q_snprintf (buffer, sizeof(buffer), "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff,
(haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff,
ntohs(((struct sockaddr_in *)addr)->sin_port));
return buffer;
}

BIN
Windows/SDL_x64.zip Normal file

Binary file not shown.

26
Windows/quakespasm.sln Normal file
View file

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quakespasm", "quakespasm.vcproj", "{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Debug|Win32.ActiveCfg = Debug|Win32
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Debug|Win32.Build.0 = Debug|Win32
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Debug|x64.ActiveCfg = Debug|x64
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Debug|x64.Build.0 = Debug|x64
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Release|Win32.ActiveCfg = Release|Win32
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Release|Win32.Build.0 = Release|Win32
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Release|x64.ActiveCfg = Release|x64
{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

844
Windows/quakespasm.vcproj Normal file
View file

@ -0,0 +1,844 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="quakespasm"
ProjectGUID="{C0F747A3-D796-4EC0-BF2A-53722CAA3B6A}"
RootNamespace="quakespasm"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\SDL\include;..\Quake;."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WSOCK32.lib OPENGL32.lib winmm.lib SDL.lib SDLmain.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="C:\SDL\lib"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="C:\SDL\include;..\Quake;."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WSOCK32.lib OPENGL32.lib winmm.lib SDL.lib SDLmain.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="C:\SDL\lib"
IgnoreAllDefaultLibraries="false"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\SDL\include;..\Quake;."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.lib OPENGL32.lib winmm.lib SDL.lib SDLmain.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="C:\SDL\lib64"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="C:\SDL\include;..\Quake;."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.lib OPENGL32.lib winmm.lib SDL.lib SDLmain.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="C:\SDL\lib64"
IgnoreAllDefaultLibraries="false"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\Quake\cd_sdl.c"
>
</File>
<File
RelativePath="..\Quake\chase.c"
>
</File>
<File
RelativePath="..\Quake\cl_demo.c"
>
</File>
<File
RelativePath="..\Quake\cl_input.c"
>
</File>
<File
RelativePath="..\Quake\cl_main.c"
>
</File>
<File
RelativePath="..\Quake\cl_parse.c"
>
</File>
<File
RelativePath="..\Quake\cl_tent.c"
>
</File>
<File
RelativePath="..\Quake\cmd.c"
>
</File>
<File
RelativePath="..\Quake\common.c"
>
</File>
<File
RelativePath="..\Quake\conback.c"
>
</File>
<File
RelativePath="..\Quake\console.c"
>
</File>
<File
RelativePath="..\Quake\crc.c"
>
</File>
<File
RelativePath="..\Quake\cvar.c"
>
</File>
<File
RelativePath=".\dirent.c"
>
</File>
<File
RelativePath="..\Quake\gl_draw.c"
>
</File>
<File
RelativePath="..\Quake\gl_fog.c"
>
</File>
<File
RelativePath="..\Quake\gl_mesh.c"
>
</File>
<File
RelativePath="..\Quake\gl_model.c"
>
</File>
<File
RelativePath="..\Quake\gl_refrag.c"
>
</File>
<File
RelativePath="..\Quake\gl_rlight.c"
>
</File>
<File
RelativePath="..\Quake\gl_rmain.c"
>
</File>
<File
RelativePath="..\Quake\gl_rmisc.c"
>
</File>
<File
RelativePath="..\Quake\gl_screen.c"
>
</File>
<File
RelativePath="..\Quake\gl_sky.c"
>
</File>
<File
RelativePath="..\Quake\gl_texmgr.c"
>
</File>
<File
RelativePath="..\Quake\gl_vidsdl.c"
>
</File>
<File
RelativePath="..\Quake\gl_warp.c"
>
</File>
<File
RelativePath="..\Quake\host.c"
>
</File>
<File
RelativePath="..\Quake\host_cmd.c"
>
</File>
<File
RelativePath="..\Quake\image.c"
>
</File>
<File
RelativePath="..\Quake\in_sdl.c"
>
</File>
<File
RelativePath="..\Quake\keys.c"
>
</File>
<File
RelativePath="..\Quake\main_sdl.c"
>
</File>
<File
RelativePath="..\Quake\mathlib.c"
>
</File>
<File
RelativePath="..\Quake\menu.c"
>
</File>
<File
RelativePath="..\Quake\net_dgrm.c"
>
</File>
<File
RelativePath="..\Quake\net_loop.c"
>
</File>
<File
RelativePath="..\Quake\net_main.c"
>
</File>
<File
RelativePath="..\Quake\net_win.c"
>
</File>
<File
RelativePath="..\Quake\net_wins.c"
>
</File>
<File
RelativePath="..\Quake\net_wipx.c"
>
</File>
<File
RelativePath="..\Quake\pl_win.c"
>
</File>
<File
RelativePath="..\Quake\pr_cmds.c"
>
</File>
<File
RelativePath="..\Quake\pr_edict.c"
>
</File>
<File
RelativePath="..\Quake\pr_exec.c"
>
</File>
<File
RelativePath="..\Quake\r_alias.c"
>
</File>
<File
RelativePath="..\Quake\r_brush.c"
>
</File>
<File
RelativePath="..\Quake\r_part.c"
>
</File>
<File
RelativePath="..\Quake\r_sprite.c"
>
</File>
<File
RelativePath="..\Quake\r_world.c"
>
</File>
<File
RelativePath="..\Quake\sbar.c"
>
</File>
<File
RelativePath="..\Quake\snd_dma.c"
>
</File>
<File
RelativePath="..\Quake\snd_mem.c"
>
</File>
<File
RelativePath="..\Quake\snd_mix.c"
>
</File>
<File
RelativePath="..\Quake\snd_sdl.c"
>
</File>
<File
RelativePath="..\Quake\sv_main.c"
>
</File>
<File
RelativePath="..\Quake\sv_move.c"
>
</File>
<File
RelativePath="..\Quake\sv_phys.c"
>
</File>
<File
RelativePath="..\Quake\sv_user.c"
>
</File>
<File
RelativePath="..\Quake\sys_sdl_win.c"
>
</File>
<File
RelativePath="..\Quake\view.c"
>
</File>
<File
RelativePath="..\Quake\wad.c"
>
</File>
<File
RelativePath="..\Quake\world.c"
>
</File>
<File
RelativePath="..\Quake\zone.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\Quake\anorm_dots.h"
>
</File>
<File
RelativePath="..\Quake\anorms.h"
>
</File>
<File
RelativePath="..\Quake\arch_def.h"
>
</File>
<File
RelativePath="..\Quake\bspfile.h"
>
</File>
<File
RelativePath="..\Quake\cdaudio.h"
>
</File>
<File
RelativePath="..\Quake\client.h"
>
</File>
<File
RelativePath="..\Quake\cmd.h"
>
</File>
<File
RelativePath="..\Quake\common.h"
>
</File>
<File
RelativePath="..\Quake\conback.h"
>
</File>
<File
RelativePath="..\Quake\console.h"
>
</File>
<File
RelativePath="..\Quake\crc.h"
>
</File>
<File
RelativePath="..\Quake\cvar.h"
>
</File>
<File
RelativePath="..\Quake\d_ifacea.h"
>
</File>
<File
RelativePath=".\dirent.h"
>
</File>
<File
RelativePath="..\Quake\draw.h"
>
</File>
<File
RelativePath="..\Quake\gl_model.h"
>
</File>
<File
RelativePath="..\Quake\gl_texmgr.h"
>
</File>
<File
RelativePath="..\Quake\gl_warp_sin.h"
>
</File>
<File
RelativePath="..\Quake\glquake.h"
>
</File>
<File
RelativePath="..\Quake\image.h"
>
</File>
<File
RelativePath="..\Quake\input.h"
>
</File>
<File
RelativePath="..\Quake\keys.h"
>
</File>
<File
RelativePath="..\Quake\mathlib.h"
>
</File>
<File
RelativePath="..\Quake\menu.h"
>
</File>
<File
RelativePath="..\Quake\modelgen.h"
>
</File>
<File
RelativePath="..\Quake\net.h"
>
</File>
<File
RelativePath="..\Quake\net_defs.h"
>
</File>
<File
RelativePath="..\Quake\net_dgrm.h"
>
</File>
<File
RelativePath="..\Quake\net_loop.h"
>
</File>
<File
RelativePath="..\Quake\net_sys.h"
>
</File>
<File
RelativePath="..\Quake\net_wins.h"
>
</File>
<File
RelativePath="..\Quake\net_wipx.h"
>
</File>
<File
RelativePath="..\Quake\platform.h"
>
</File>
<File
RelativePath="..\Quake\pr_comp.h"
>
</File>
<File
RelativePath="..\Quake\progdefs.h"
>
</File>
<File
RelativePath="..\Quake\progs.h"
>
</File>
<File
RelativePath="..\Quake\protocol.h"
>
</File>
<File
RelativePath="..\Quake\q_stdinc.h"
>
</File>
<File
RelativePath="..\Quake\qs_bmp.h"
>
</File>
<File
RelativePath="..\Quake\quakedef.h"
>
</File>
<File
RelativePath="..\Quake\render.h"
>
</File>
<File
RelativePath="..\Quake\resource.h"
>
</File>
<File
RelativePath="..\Quake\sbar.h"
>
</File>
<File
RelativePath="..\Quake\screen.h"
>
</File>
<File
RelativePath="..\Quake\server.h"
>
</File>
<File
RelativePath="..\Quake\sound.h"
>
</File>
<File
RelativePath="..\Quake\spritegn.h"
>
</File>
<File
RelativePath="..\Quake\sys.h"
>
</File>
<File
RelativePath="..\Quake\vid.h"
>
</File>
<File
RelativePath="..\Quake\view.h"
>
</File>
<File
RelativePath="..\Quake\wad.h"
>
</File>
<File
RelativePath="..\Quake\winquake.h"
>
</File>
<File
RelativePath="..\Quake\world.h"
>
</File>
<File
RelativePath="..\Quake\wsaerror.h"
>
</File>
<File
RelativePath="..\Quake\zone.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\QuakeSpasm.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>