GameMonkey Script

GameMonkey Script Forums
It is currently Mon Nov 20, 2017 3:36 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Jul 24, 2012 12:03 pm 
Offline

Joined: Tue Jul 24, 2012 11:18 am
Posts: 3
Line 415 of .../binds/gmSystemLib.cpp:
#if 1 // Compatible with 64bit OS
and similar line 587:
#if 1 // Compatible with 64bit OS

For me #if 0
would have been a better value.

Seriously, I don't know, but I guess that there exist some defined value that would allow for testing for 64 bits?
A fast Googling give me this: http://stackoverflow.com/questions/1505 ... 4-bit-in-c

#if ((ULONG_MAX) == (UINT_MAX))
# define IS32BIT
#else
# define IS64BIT
#endif

or this:
// Check windows
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif

// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 25, 2012 9:56 am 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 698
Welcome to the forum Zartox :) And thanks for posting and answering posts.

There is a GM_PTR_SIZE_64 / 32 defined in the platform config files. This should use define _M_X64 (which I think has some portability beyond MSVC).
Whichever way, GM_PTR_SIZE_64 should be set in the platform config and should be used in the gmSystemLib.cpp instead of #if 1 / 0.

I recall the system lib being hacked to work on some 64bit platform (hence the #if 1) long before the whole project had a pass at 64bit compatibility (the GM_PTR_SIZE_64). The non-windows platform configs have not been updated in my build so they are from the time when everything was incorrectly typed as 'gmptr' which was an 'int'.

I'll try to clean some of this up soon in my build.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group