How to differentiate between ubuntu and redhat using c preprocessor ?

Z

Zeno

Guest
Hi,

I am a newbie to C programming, I am writing a cross platform C code. Is there any C preprocessor to differentiate between Ubuntu and RedHat Linux Distros?

Is there any other way I can do this?

Thanks in Advance.
 


A

Akendo

Guest
Hi Zeno,

Welcome to the LinuxForum.

In every Linux your using the GNU Compiler Collection (Wikipedia:gcc). The only different is sometime where there are locates as file itself. Redhat sometime (or Ubuntu/Debian). But this should not matter.

But Redhat uses always the older and stable releases of the gcc. So when your develop with something new you can't expect working in Redhat by default.


Hopefully this was helpful.

so far
Akendo
 
T

Theophrastus

Guest
Hi,

I am a newbie to C programming, I am writing a cross platform C code. Is there any C preprocessor to differentiate between Ubuntu and RedHat Linux Distros?

Is there any other way I can do this?

Thanks in Advance.
some combination of this sort of maneuver may accomplish that:
gcc "-DCOMPILED_ON=\"`uname -a`\"" -c file.c -o file.o

see:
for some odd reason i'm not seeing how i can be permitted to include a useful link to this approach perhaps if i mangle the link i can get it through: "http:" + // +
stackoverflow.com/questions/5319289/can-the-gcc-c-preprocessor-use-the-output-of-a-shell-command
 



Members online


Latest posts


Top