Compiler option: -D

Compiler option: -D

Post by jaxoj.. » Thu, 04 Apr 2002 10:59:59



Hi, I'm using CW 8.1 for Palm OS. Is there not a way to define a macro
with a compiler option like I can do with other C/C++ compilers' -D
switch? If not, is there some other way to do this without touching
most of my existing source files? I was to define _MSL_NO_IO so that
ios definitions are not included in iostream. Thanks, Joe
 
 
 

Compiler option: -D

Post by Ben Combe » Thu, 04 Apr 2002 12:33:32




Quote:> Hi, I'm using CW 8.1 for Palm OS. Is there not a way to define a macro
> with a compiler option like I can do with other C/C++ compilers' -D
> switch? If not, is there some other way to do this without touching
> most of my existing source files? I was to define _MSL_NO_IO so that
> ios definitions are not included in iostream. Thanks, Joe

The way to do this is to use a prefix file.  These are described in the
C/C++ Compiler manual.  You specify a prefix in the C/C++ Language pref
panel, and it can contain any defintions you want.  We normally use this
to include a precompiled header to speed compilation, but your prefix
can do that as its first action, so if you see

PalmOS_Headers_Strict

in there now, make your prefix file

#include "PalmOS_Headers_Strict"
#define _MSL_NO_IO

Note: the MSL C++ library, as shipped in (MSL for Palm OS), has the MSL
C++ macros all setup in the mslconfig_Palm_OS file.  I didn't define
_MSL_NO_IO because I wanted the library to support streams in a our of
strings.  If it works with stringstreams and strstreams with _MSL_NO_IO
set, then that would actually be a good option to enable for all of MSL
on Palm OS, at least until I get a chance to implement standard I/O for
VFS files.

--

CodeWarrior for Palm OS technical lead

 
 
 

Compiler option: -D

Post by jaxoj.. » Fri, 05 Apr 2002 02:21:16


Thanks, Ben, I once again appreciate your answers.