Jump to content

[PATCH] make map extractor 64-bit safe


Guest plaes

Recommended Posts

I don't quite understand why you check __WORDSIZE when there's already all integer types defined in <stdint.h> which is already included anyway.

Just use the intN_t defines for all platforms, that's why they very added in C99 after all...

The only type coming out wrong was "typedef long int32;" anyway...and despite that i already have used the extractor successfully without changes on 64bit Linux, which somewhat puzzles me right now o.O

Link to comment
Share on other sites

The only type coming out wrong was "typedef long int32;" anyway...and despite that i already have used the extractor successfully without changes on 64bit Linux, which somewhat puzzles me right now o.O

Well, the extractor did not work for me and this patch fixed it (for me).

On 64-bit machine:

sizeof(long): 8
sizeof(short): 2
sizeof(unsigned long): 8
sizeof(unsigned short): 1

32-bit machine:

sizeof(long): 4
sizeof(short): 2
sizeof(unsigned long): 4
sizeof(unsigned short): 1

Link to comment
Share on other sites

  • 3 months later...

Somebody can test whether that one would work fine?

#ifdef WIN32typedef __int64            int64;
typedef __int32            int32;
typedef __int16            int16;
typedef __int8             int8;
typedef unsigned __int64   uint64;
typedef unsigned __int32   uint32;
typedef unsigned __int16   uint16;
typedef unsigned __int8    uint8;
#else
#include <stdint.h>
#ifndef uint64_t 
#include <linux/types.h> 
#endif
typedef int64_t            int64;
typedef int32_t            int32;
typedef int16_t            int16;
typedef int8_t             int8;
typedef uint64_t           uint64;
typedef uint32_t           uint32;
typedef uint16_t           uint16;
typedef uint8_t            uint8;
#endif

I don't use a 64-bit OS, so I can't test it myself.

Link to comment
Share on other sites

Windows part of changes is ok for x64. Not sure that this only need change from other side.

Before this can be tested under winsows need create related projectes mode and resolve conflict settings for x32

Laos note that existed #include <linux/types.h> will not build at FreeBSD or any othoer not linux OSs

Link to comment
Share on other sites

  • 1 year later...

(yes, one more old thread getting bumped by me...)

i think the extractor should stay under /contrib/ but needs a general update/rewrite (the code is *really* messy). i'd also like to see it being 64bit safe. using ACE for it might be a good idea. i'm not very good in threading, but it might also give a speedup if we'd use ACE to make the extractors (map + vmap) multithreaded (not sure whether IO or calculations use more power, but i'd say calculations, so multithreading might be worth it).

i already started a branch where i'm working on making projects under 64bit safe (and also doing other stuff on the projects^^): http://github.com/DasBlub/mangos/commits/x64

maybe i'll give it a shot later, when i'm done with the other projects. anyone is free to already do it :)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use