Skip to main content
GameDev.net gamedev.net
🔒 Locked

preprocessing prob

Started by djsomers Oct 17, 2001 at 8:34 AM 3 replies 250+ views
Original Post
djsomers
djsomers
I am making a game that can be compiled in Borland CPP and in MS VC, but I need to do some preprocessing to help out some incompatibilities. Thing is I would like to make two seperate projects, but this is not viable, so I must go this route: I have done the following: #if defined (__BORLANDC__) // borland specific pre-processor directives #ifndef __WIN32__ #error compile using a WIN32 GUI compiler #endif #ifndef __cplusplus #error Must use C++ compiler. #endif #elif // MS VC specific pre-processor directives #ifndef _WIN32 #error compile using a WIN32 GUI compiler #endif #ifndef _MMSYSTEM_H_ #include #define _MMSYSTEM_H #endif #endif Borland is fine with it, but VC finds an error with the #elif I am Flumuxed ! please help djsomers
djsomers;)make it idiot proof and someone makes a better idiot!
fisher
fisher
Borland is fine with it, but VC finds an error with the
#elif
relax and try #else if
(f) Fisher
djsomers
djsomers

I changed the elif to an else like below:

Now VC show the error "compile with a WIN32 compiler" as if it doesn''t recognise _WIN32 ?????



#if defined (__BORLANDC__) // borland specific pre-processor directives
#ifndef __WIN32__
#error compile using a WIN32 GUI compiler
#endif
#ifndef __cplusplus
#error Must use C++ compiler.
#endif
#else ifndef _WIN32 // MS VC specific pre-processor directives
#error compile using a WIN32 GUI compiler
#ifndef _MMSYSTEM_H_
#include
#define _MMSYSTEM_H
#endif
#endif
djsomers;)make it idiot proof and someone makes a better idiot!
Prosper/LOADED
Prosper/LOADED
Try this :

#if defined (__BORLANDC__) // borland specific pre-processor directives
#ifndef __WIN32__
#error compile using a WIN32 GUI compiler
#endif
#ifndef __cplusplus
#error Must use C++ compiler.
#endif
#else
#ifndef _WIN32 // MS VC specific pre-processor directives
#error compile using a WIN32 GUI compiler
#endif
#ifndef _MMSYSTEM_H_
#include
#define _MMSYSTEM_H
#endif
#endif


nickm
nickm
Well you are using just

#elif

I think the problem is there''s no condition. If you don''t need a condition, use #else

Nick

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.