GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: #ifdef parameter for OS version
Operating System - HP-UX
1849122
Members
5299
Online
104041
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 08:31 AM
02-27-2003 08:31 AM
I can write OS dependent code using '#ifdef __hpux'. Is there a way to make the code depent on the version of the HP-UX (10.20 vs 11)?
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2003 11:38 AM
02-28-2003 11:38 AM
Solution
There is no predefined macro for the OS version. You could define your own macro in a makefile. Something like -DOSRELEASE=$(uname -r) might work.
I prefer to test for a header file macro specific to some new feature I want to use. That makes the connection between the ifdef and the feature much more direct.
Here is an example-
#include
...
#ifdef PST_N_PG_SIZES /* only on 11.0 and later */
printf("pst_pagesize_hint: %lld\n",(long long) pst.pst_pagesize_hint);
#endif /* PST_N_PG_SIZES */
I prefer to test for a header file macro specific to some new feature I want to use. That makes the connection between the ifdef and the feature much more direct.
Here is an example-
#include
...
#ifdef PST_N_PG_SIZES /* only on 11.0 and later */
printf("pst_pagesize_hint: %lld\n",(long long) pst.pst_pagesize_hint);
#endif /* PST_N_PG_SIZES */
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP