Operating System - HP-UX
1833770 Members
2258 Online
110063 Solutions
New Discussion

DEFINES option for c compilation in HP UX

 
tvravikanth
New Member

DEFINES option for c compilation in HP UX

For Borland the following DEFINES are used
DEFINES=__WIN32__,_Windows,__CDECL__

For Solaris the following DEFINES are used
DEFINES=__SunOS_5_6,__SUNPRO_C=0x500,__SVR4,__unix,__sun,__sparc,__BUILTIN_VA_ARG_INCR,__PRAGMA_REDEFINE_EXTNAME,unix,sun,sparc,__RESTRICT,_FILE_OFFSET_BITS=32

Similarly what are the DEFINES that must be used for HP UX ?
3 REPLIES 3
Umapathy S
Honored Contributor

Re: DEFINES option for c compilation in HP UX

Ravi,
I will start with some basic stuff. I dont know what does all in the above list mean. This differs depending upon the hpux you use.

-D_HPUX_SOURCE -D_REENTRANT -Dunix -Dhpux -Dhp9000sXXX

where XXX will be 800 or 900 depending upon your architecture.

If you give more details on which OS and architecture, then other forumers may help out.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Mike Stroyan
Honored Contributor

Re: DEFINES option for c compilation in HP UX

There is a list of possible predefined macros under the -U option in 'man cpp' The list will
vary for different hardware. (The newer Itanium based systems define __ia64.)
--------------------------------------------
-Uname Remove any initial definition of name, where name is a
reserved symbol that is predefined by the particular
preprocessor. The current list of these symbols
includes:

Operating system: unix __unix

Hardware: hp9000s200 hp9000s300 __hp9000s300
hp9000s500 hp9000s800 __hp9000s800
hp9000ipc hppa __hppa
_PA_RISC1_0 _PA_RISC1_1 _SIO _WSIO

UNIX systems variant: hpux __hpux
_HPUX_SOURCE PWB
_PWB

lint(1): lint __lint

In addition, all symbols that begin with an underscore
and either an upper-case letter or another underscore
are reserved. Other symbols may be defined by the
CCOPTS variable or other command-line options to the C
compiler at compile time (see cc(1)). All HP-UX
systems have the symbols PWB, hpux, unix, _PWB, __hpux,
and __unix defined. Each system defines at least one
hardware variant, as appropriate. The lint symbols are
defined when lint(1) is running. See DEPENDENCIES.

Two special names are understood by cpp. __LINE__ is defined as the
current line number (as a decimal integer) as counted by cpp.
__FILE__ is defined as the current file name (as a C string) as known
by cpp. They can be used anywhere (including in macros) just as any
other defined names.
--------------------------------------------
V. Nyga
Honored Contributor

Re: DEFINES option for c compilation in HP UX

Sorry for chatting ...
Mike Stroyan, please visit this link

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa21f5fe8b250d71190080090279cd0f9,00.html

Volkmar
*** Say 'Thanks' with Kudos ***