latest cvs compile error
Moderator: ZSNES Mods
-
- Rookie
- Posts: 32
- Joined: Wed Aug 25, 2004 1:55 pm
- Location: spb, ru
- Contact:
latest cvs compile error
I can't compile zsnes using MSVC6. It shows errors with jma\portable.h about 'long can't be followed by long'. Removing all JMA related stuff allows to compile zsnes as usual.
The definitions of INT64 and UINT64 in jma\portable.h are not MSVC-friendly. In revisions 1.1-1.2 they look like this:Bahamut_ZERO_939 wrote:What exact compile rror did it generate?
Code: Select all
typedef long long INT64;
typedef unsigned long long UINT64;
As a side note, some people here might be interested in POSH (Portable Open Source Header): http://www.bookofhook.com/poshlib/Overview.html
It is a header file which detects many different compilers, etc. It is easy to use, has no external dependencies, and the license is very liberal. It is probably overkill for ZSNES, but it might come in handy if you work on other cross-platform projects.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
It would be a lot easier if MSVC supported the C99 standard where long long was introduced.
I suspect that since ipher has no trouble compiling, he has a more up to date MSVC.
I suspect that since ipher has no trouble compiling, he has a more up to date MSVC.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
IIRC, MSVC6 was released a long time before 99 
I guess you will need the common gorp, something like:
(I didn't test this, it might contain typos)

I guess you will need the common gorp, something like:
Code: Select all
#ifdef _MSC_VER
typedef __int64 INT64;
typedef unsigned __int64 UINT64;
#else
typedef long long INT64;
typedef unsigned long long UINT64;
#endif
it should compile using the vstudio-2003 compiler, as there is a binary at http://cvscompile.aep-emu.de dated to 11/28
A few weeks ago I compiled wip sources with the freely available 2003 version of the MS compiler. I used the include and lib directories from MSVC6, but only for files not supplied with the 2003 compiler. I used the DirectX 9.0 SDK. It compiled fine and it seemed to work--but I didn't test the resulting binary much so I have no idea if it was stable.
-
- Rookie
- Posts: 32
- Joined: Wed Aug 25, 2004 1:55 pm
- Location: spb, ru
- Contact:
-
- Rookie
- Posts: 32
- Joined: Wed Aug 25, 2004 1:55 pm
- Location: spb, ru
- Contact:
Ok, I finally was able to compile latest cvs code with my good old msvc6 
If someone ever need this, here's what should be changed in sources:
jma\portable.h: replace "long long" with "__int64"
win\winlink.cpp: replace
with
zloader.c: replace "#include <unistd.h>" with "#include <io.h>"
To make it compile properly using mingw's make, edit makefile.ms in this way:
1. replace
with
2. replace "}\*" with "}\\\*"
It should compile now. I hope I didn't forget anything..

If someone ever need this, here's what should be changed in sources:
jma\portable.h: replace "long long" with "__int64"
win\winlink.cpp: replace
Code: Select all
volatile __int64 copymaskRB = 0x001FF800001FF800LL;
volatile __int64 copymaskG = 0x0000FC000000FC00LL;
volatile __int64 copymagic = 0x0008010000080100LL;
volatile __int64 coef = 0x0066009a0066009aLL;
Code: Select all
volatile __int64 copymaskRB = 0x001FF800001FF800i64;
volatile __int64 copymaskG = 0x0000FC000000FC00i64;
volatile __int64 copymagic = 0x0008010000080100i64;
volatile __int64 coef = 0x0066009a0066009ai64;
To make it compile properly using mingw's make, edit makefile.ms in this way:
1. replace
Code: Select all
ifeq (${CROSS},no)
TRUTH=
DELETECOMMAND=del
SLASH=\${BLAHBLAHBLAH}
endif
Code: Select all
#ifeq (${CROSS},no)
# TRUTH=
# DELETECOMMAND=del
# SLASH=\${BLAHBLAHBLAH}
#endif
It should compile now. I hope I didn't forget anything..
