[FIX] Compilation errors under MinGW 3.4.4 and win2000

Alex Malyshev alexript at gmail.com
Tue Jun 5 06:35:01 EDT 2007


Sorry for my english.

There are compilation error for physfs 1.1.1 under mingv 3.4.4 and windows
2000

Some info:

E:\>gcc -v
Reading specs from E:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=min
gw32 --prefix=/mingw --enable-threads --disable-nls
--enable-languages=c,c++,f77,ada,objc,java --dis
able-win32-registry --disable-shared --enable-sjlj-exceptions
--enable-libgcj --disable-java-awt --w
ithout-x --enable-java-gc=boehm --disable-libgcj-debug
--enable-interpreter --enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.4 (mingw special)

Path:

Index: physfs_internal.h
===================================================================
--- physfs_internal.h	(revision 44)
+++ physfs_internal.h	(revision 45)
@@ -57,6 +57,10 @@
   #define __PHYSFS_SMALLALLOCTHRESHOLD 128
   void *__PHYSFS_initSmallAlloc(void *ptr, PHYSFS_uint64 len);

+#ifndef alloca
+#define alloca(x) __builtin_alloca(x)
+#endif
+
   #define __PHYSFS_smallAlloc(bytes) ( \
       __PHYSFS_initSmallAlloc((((bytes) < __PHYSFS_SMALLALLOCTHRESHOLD) ? \
                                alloca((size_t)((bytes)+1)) : NULL),
(bytes)) \


Index: windows.c
===================================================================
--- windows.c	(revision 44)
+++ windows.c	(revision 45)
@@ -27,9 +27,9 @@
   #include "physfs_internal.h"

   #define LOWORDER_UINT64(pos) (PHYSFS_uint32) \
-    (pos & 0x00000000FFFFFFFF)
+    (pos & 0x00000000FFFFFFFFULL)
   #define HIGHORDER_UINT64(pos) (PHYSFS_uint32) \
-    (((pos & 0xFFFFFFFF00000000) >> 32) & 0x00000000FFFFFFFF)
+    (((pos & 0xFFFFFFFF00000000ULL) >> 32) & 0x00000000FFFFFFFFULL)

   /*
    * Users without the platform SDK don't have this defined.  The original
docs
@@ -353,6 +353,7 @@

       /* may truncate, but oh well. */
       PHYSFS_utf8FromUcs2((PHYSFS_uint16 *) msgbuf, utf8buf, sizeof
(utf8buf));
+    rc = (DWORD)NULL;  // stop-warning Unused variable
       return((const char *) utf8buf);
   } /* winApiStrError */

@@ -360,7 +361,7 @@
   static char *getExePath(void)
   {
       DWORD buflen = 64;
-    int success = 0;
+//    int success = 0;  // stop-warning Unused variable
       LPWSTR modpath = NULL;
       char *retval = NULL;



-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/



More information about the physfs mailing list