Hi,
Please try the attached c file. It printed "Solaris" for me in a Solaris
box.
And if you run "cc -### a.c" on the command line it will give some
useful info.
Thanks,
Bala
On Fri, 2005-10-07 at 10:27, Veena M Shettar wrote:
> The following code does not work properly for solaris
>
> How to detect solaris platform in c ? The following code displays
> "Linix" though
>
> Im excuting this code on solaris
>
> #include<stdio.h>
>
> main()
>
> {
>
> #ifdef _WIN32_
>
> {
>
> printf("windows");
>
> }
>
> #endif
>
> #ifdef __linux__
>
> #define _LINUX_
>
> #endif
>
> #ifdef SOLARIS
>
> {printf("Solaris");
>
> }
>
> #else
>
> {
>
> printf("Linix");
>
> }
>
> #endif
>
> }
>
>
>
> ______________________________________________________________________
> _______________________________________________
> opensolaris-discuss mailing list
> opensolaris-discuss@opensolaris.org
Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL
PROTECTED] immediately
and destroy all copies of this message and any attachments.
#include<stdio.h>
int main()
{
#ifdef _WIN32_
printf("windows");
#endif
#ifdef __linux__
#define _LINUX_
#endif
#ifdef __sun
printf("Solaris");
#else
printf("Linix");
#endif
return 0;
}
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org