1828490 Members
2306 Online
109978 Solutions
New Discussion

indef_unix_

 
SOLVED
Go to solution
Sangeeta Gupta
Occasional Contributor

indef_unix_

Hi,

I am trying to run a C code which is succesfully running on Tru64 but is not running on HP-UX.

I have a doubt that it is failing because it is not able to resolve as to whether is it executed on unix environment or not .
Do i need to change "indef_unix_" to something else to run it on HP-UX system?

Thanks in advance
4 REPLIES 4
Sandman!
Honored Contributor

Re: indef_unix_

Could you post the error messages you are getting while trying to run on an hp-ux system.
Steven Schweda
Honored Contributor
Solution

Re: indef_unix_

It might help a little to:

1. Know what you mean by "not running".

2. Know what "indef_unix_" really is. If we
can believe the documentation, Compaq C on
Tru64 defines "__unix__", not "_unix_".

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN1/0607____.HTM
(Look for "C preprocessor macros".)

If you're using "_unix_", who is defining it
on Tru64?

3. See some of the actual code.

4. See how you're compiling it.
Steven Schweda
Honored Contributor

Re: indef_unix_

Also, "man cc" (or "man aCC") on HP-UX may
provide some information on the macros
defined by the compiler/preprocessor on
HP-UX. (Knowing which compiler you're using,
and the system type, might also be
interesting.)

A quick look suggests that "__unix" is more
likely than "__unix__" on HP-UX, but these
things may depend on the compiler options.
Dennis Handly
Acclaimed Contributor

Re: indef_unix_

Steven is correct. Looking at IPF man pages will tell you what is set. For PA you can look at cpp(1). Note when not in K&R mode, the symbols without leading "_" are not defined. __unix & __hpux are the default for HP-UX.