On Tue, 2 Sep 2003, Voguemaster wrote:

> Hi list,
>
> I'm writing a portable set of classes for a network application
> (the classes will be reused) for Win32 and Linux. I don't wish to
> use external libraries since those are simple primitives.
>
> I'm generally using some #ifdef statements (although I've minimized their
> use using a header file for a class and 2 source files (one per platform).
>
> Now, as it seems, #ifdef doesn't support something like this:
>
> #if defined(..)
> ..
> #elif defined(..)
> ..
> #endif
>

Actually you can write:

#ifdef ..
.
#elif defined(..)
.
#endif

As #ifdef is exactly equivalent to #if defined(..).

Regards,

        Shlomi Fish

>
> I only recently discovered theGNU preprocessor actually supports those
> (hehe, dumb, i know..) but I was wondering if anyone knows the earliest
> version of Linux in which this set of directives is supported on.
> (I would like to be able to compile this thing on RH6.2, for example).
>
> My biggest concern is portability. I'd like to make sure the code compiles
> nicely on any system this thing is going to be compiled on :)
>
> Thanks to anyone who might know.
>
> Eli
>
> PS.
>
> A related question I once posted was how to detect the platform on which
> a program is compiled on. Seems there are plenty of macros defined in
> various platforms. Encountered a few good ones in Doxygen's headers :).
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
>



----------------------------------------------------------------------
Shlomi Fish        [EMAIL PROTECTED]
Home Page:         http://t2.technion.ac.il/~shlomif/

There's no point in keeping an idea to yourself since there's a 10 to 1
chance that somebody already has it and will share it before you.


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to