[quake3] first win64 patch
Shane Isley
shane at it.uts.edu.au
Sat Feb 18 22:49:19 EST 2006
Hi,
I've a process that is doing a hourly Win32 build from the head.
http://www.promode.org/files/ioq3.zip
I believe zakk wanted it linked on icculus.org/quake3
Anyhow commit 550 broke my Win32 build (I'm using VS 2005 and also
vcbuild.exe).
<inttypes.h> was the problem, in that Windows or MSVC do not come with it.
I began fixing my problen by adding my cygwin version of inttypes.h, but
it depended on another header and so on and so forth.
So it ended up simpler to do this:
Index: q_shared.h
===================================================================
--- q_shared.h (revision 553)
+++ q_shared.h (working copy)
@@ -104,7 +104,7 @@
#ifdef Q3_VM
typedef int intptr_t;
-#else
+#elif !WIN32
#include <inttypes.h>
#endif
Index: vm.c
===================================================================
--- vm.c (revision 553)
+++ vm.c (working copy)
@@ -886,6 +886,11 @@
f = fopen("syscalls.log", "w" );
}
callnum++;
+#ifndef WIN32
fprintf(f, "%i: %"PRIiPTR" (%i) = %i %i %i %i\n", callnum,
(intptr_t)(args - (int *)currentVM->dataBase),
args[0], args[1], args[2], args[3], args[4] );
+#else
+ fprintf(f, "%i: %li (%i) = %i %i %i %i\n", callnum, (intptr_t)(args
- (int *)currentVM->dataBase),
+ args[0], args[1], args[2], args[3], args[4] );
+#endif
}
I had to also change the printf(). The compiler kept bombing with
regards to the argument type (PRIiPTR or li) being outside the quotes"".
If this could be improved upon and added to the repository, I'd be greatful.
Rregards,
Shane
Ludwig Nussel wrote:
>James Lacey wrote:
>
>
>>Here is my first Win64 Quake 3 patch. A couple of notes:
>>
>>
>
>I've now changed the code to use intptr_t instead of long where I
>think it needs to. Since long works fine on Linux I can't check
>whether I catched everything though. Would be nice if you could try
>to create a minimal patch (ie without the size_t changes) based on
>that to make it work on 64bit Windows.
>
>cu
>Ludwig
>
>
>
More information about the quake3
mailing list