why #if defined(SOLARIS) is not detecting solaris operating system in my source ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshjumgam
    New Member
    • Dec 2010
    • 10

    why #if defined(SOLARIS) is not detecting solaris operating system in my source ?

    #include <stdio.h>
    #include <stdlib.h>
    #ifdef linux
    #include <string.h>
    #include <unistd.h>
    #endif
    int main()
    {
    #ifdef WIN32
    printf("In Windows");
    # else
    #if defined(SOLARIS )
    printf("Im in Solaris");
    #endif
    #ifdef linux
    printf("In Linux");
    #endif
    #endif
    }


    what is wrong in my code?
    environment :SunOS 5.10 Generic_137111-08 sun4u sparc SUNW,Sun-Fire-V215

    there is no compilation error while compiling and while executing it is not printing Im in Solaris.

    if i change in my code #if defined(SOLARIS ) this to #if defined(__sun) it is working fine.

    plz replay to this ?

    Thanks in advance.....
  • Jason Mortmer
    New Member
    • Feb 2011
    • 23

    #2
    Whats your problem? __sun works fine, you already fixed it? If you are that desparate to use SOLARIS, do #define SOLARIS __sun

    Comment

    Working...