|
From: <cro...@li...> - 2003-08-02 16:25:23
|
Module Name: crossfire
Committed By: tchize
Date: Sat Aug 2 16:25:23 UTC 2003
Modified Files:
crossfire/common: map.c
crossfire/include: global.h
Log Message:
WIN32 bugfixes, (mappath fix and uint64 fix)
thanks to Nicolas Wegeer for submit.
Partial Transcript from mail:
...
The first, global.patch, fixes bad u/sint46 for Win32 in
include/global.h
There was no SIZEOF_LONG defined, so it would error...
Also, the Python includes define SIZEOF_LONG_LONG as 8, so it's better
to have some coherence somewhere :-)
The second is for common/map.c
It fixes broken check_path which would simply ignore the prepend_dir
argument, resulting in broken map links in big maps... (would try to
find map in world/world_xxx_xxx instead of
share/maps/world/world_xxx_xxx).
I think they don't change anything for other platforms.
...
Start of context diffs
Index: crossfire/common/map.c
diff -c crossfire/common/map.c:1.55 crossfire/common/map.c:1.56
*** crossfire/common/map.c:1.55 Mon Jun 30 12:14:13 2003
--- crossfire/common/map.c Sat Aug 2 09:25:23 2003
***************
*** 1,6 ****
/*
* static char *rcsid_map_c =
! * "$Id: map.c,v 1.55 2003/06/30 19:14:13 tchize Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_map_c =
! * "$Id: map.c,v 1.56 2003/08/02 16:25:23 tchize Exp $";
*/
/*
***************
*** 179,187 ****
int check_path (char *name, int prepend_dir)
{
- #ifdef WIN32 /* ***win32: check this sucker in windows style. */
- return(_access(name,0));
- #else
char buf[MAX_BUF], *endbuf;
struct stat statbuf;
int mode = 0, i;
--- 179,184 ----
***************
*** 190,195 ****
--- 187,195 ----
strcpy (buf, create_pathname(name));
else
strcpy(buf, name);
+ #ifdef WIN32 /* ***win32: check this sucker in windows style. */
+ return(_access(name,0));
+ #else
/* old method (strchr(buf, '\0')) seemd very odd to me -
* this method should be equivalant and is clearer.
Index: crossfire/include/global.h
diff -c crossfire/include/global.h:1.41 crossfire/include/global.h:1.42
*** crossfire/include/global.h:1.41 Fri Mar 7 21:35:32 2003
--- crossfire/include/global.h Sat Aug 2 09:25:22 2003
***************
*** 1,6 ****
/*
* static char *rcsid_global_h =
! * "$Id: global.h,v 1.41 2003/03/08 05:35:32 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_global_h =
! * "$Id: global.h,v 1.42 2003/08/02 16:25:22 tchize Exp $";
*/
/*
***************
*** 59,64 ****
--- 59,74 ----
typedef signed char sint8;
typedef unsigned short Fontindex;
+ #ifdef WIN32
+ // Python plugin stuff defines SIZEOF_LONG_LONG as 8, and besides __int64 is a 64b type on MSVC...
+ // So let's force the typedef
+ typedef unsigned __int64 uint64;
+ typedef signed __int64 sint64;
+ // Needed for experience
+ #define atoll _atoi64
+
+ #else // WIN32
+
#if SIZEOF_LONG == 8
typedef unsigned long uint64;
typedef signed long sint64;
***************
*** 70,76 ****
error correct and send mail to crossfire-devel on how to do this
#endif
!
/* global stuff used by new skill/experience system -b.t.
--- 80,86 ----
error correct and send mail to crossfire-devel on how to do this
#endif
! #endif // WIN32
/* global stuff used by new skill/experience system -b.t.
|