vBulletin Search Engine Optimization
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hello world,
I'm looking for predefined constant(s) which would give me the version and release numbers of HP-UX during compiler runs, i.e. sth universal and unique like "__hpux" I could put into an #ifdef. As a workaround I've tried to use "-D..." settings during make & compile, but unfortunately HP's "uname" implementation is braindead (IMHO). So when I'm running under 11.00 `uname -v` gives me B.11.00 (would have expected just "11") and `uname -r` gives me some nonsense (would have expected just "00"). I know that e.g. AIX predefines -D_AIX41 for everything higher than Version 4.1 and -D_AIX43 for everything higher than Version 4.3, and so forth. Is there an equivalent on HP-UX ? |
|
|||
|
Michael Kraemer wrote:
> I'm looking for predefined constant(s) which would give > me the version and release numbers of HP-UX during compiler runs, The HP-UX user space architect doesn't want this. He says you are suppose to use the feature test macros, not OS versions. > but unfortunately HP's "uname" implementation is braindead (IMHO). The proper way to use uname(1) is: $ echo $(uname -r | sed -e 's/..//' -e 's/\.//') |
|
|||
|
Dennis Handly schrieb:
> Michael Kraemer wrote: > >> I'm looking for predefined constant(s) which would give >> me the version and release numbers of HP-UX during compiler runs, > > > The HP-UX user space architect doesn't want this. He says you are > suppose to use the feature test macros, not OS versions. OK, then how do I test (on the #ifdef level) the existence of e.g. dlopen() and friends, w/o including dlfcn.h ? These do not exist in earlier versions ( 9, 10.x ?). >> but unfortunately HP's "uname" implementation is braindead (IMHO). > > The proper way to use uname(1) is: > $ echo $(uname -r | sed -e 's/..//' -e 's/\.//') OK, I'll give it a try. Meanwhile, I have found a section in the FAQ, with a test on certain flags defined in <sys/privgrp.h>. Is this safe enough ? Looks a bit dodgy to me. thanks anyway. |
|
|||
|
On Thu, 17 Jan 2008, Michael Kraemer wrote:
> Date: Thu, 17 Jan 2008 16:10:07 +0000 (UTC) > From: Michael Kraemer <[email protected]> > Newsgroups: comp.sys.hp.hpux > Subject: HP-UX version/release numbers, how ? > > hello world, > > I'm looking for predefined constant(s) which would give > me the version and release numbers of HP-UX during compiler runs, > i.e. sth universal and unique like "__hpux" I could put into an #ifdef. > > As a workaround I've tried to use "-D..." settings during make & compile, > but unfortunately HP's "uname" implementation is braindead (IMHO). > So when I'm running under 11.00 > `uname -v` gives me B.11.00 (would have expected just "11") > and > `uname -r` gives me some nonsense (would have expected just "00"). > > I know that e.g. AIX predefines -D_AIX41 for everything higher than Version 4.1 > and -D_AIX43 for everything higher than Version 4.3, and so forth. > Is there an equivalent on HP-UX ? > > For gcc on just about every platform I compile upon, i create a script I call predefined, which takes a single argument, the compiler you use, and it will show you what is predefined on that particular platform: predefined gcc The file contains the following single line: $1 -E -dM - < /dev/null HTH Rob Sciuk ---- Posted via Pronews.com - Premium Corporate Usenet News Provider ---- http://www.pronews.com offers corporate packages that have access to 100,000+ newsgroups |
|
|||
|
[email protected] schrieb:
> > For gcc on just about every platform I compile upon, i create a script > I call predefined, which takes a single argument, the compiler you use, > and it will show you what is predefined on that particular platform: > > predefined gcc > > The file contains the following single line: > > $1 -E -dM - < /dev/null > > HTH > Rob Sciuk Unfortunately this is not quite what I was looking for. Apart from the fact that I use native compilers wherever possible, your example gives a lot of #defines, but not the OS version. And it does not give me the opportunity to put a simple #if defined(__hpux) && ( OSVERSION < 1000 ) into the source code. |