HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Finding 32 bit or 64
Operating System - HP-UX
1834515
Members
2305
Online
110068
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
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
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
04-01-2004 08:44 PM
04-01-2004 08:44 PM
Finding 32 bit or 64
I am writing ver simple helloworld like program .How can i detect whether i am compiling it for 32bit or 64 bit i tried LP64 bu it dint work here is the code
include
#ifdef LP64
#define var 64
#endif
#ifndef LP64
#define var 32
#endif
void main()
{
printf("%d",var);
}
include
#ifdef LP64
#define var 64
#endif
#ifndef LP64
#define var 32
#endif
void main()
{
printf("%d",var);
}
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:26 PM
04-01-2004 09:26 PM
Re: Finding 32 bit or 64
if (sizeof (int *) == 8) {
printf ("64 bit\n");
}
else {
print "32bit\n";
}
cpp symbols you could look for are
_FILE_OFFSET_BITS
_ILP32
_LFS64_LARGEFILE
And as long as you don't state which compiler you use, it's pretty hard to guess what cpp symbols are defined. gcc has a different set of symbols as HP's C-ANSI-C
Enjoy, Have FUN! H.Merijn
printf ("64 bit\n");
}
else {
print "32bit\n";
}
cpp symbols you could look for are
_FILE_OFFSET_BITS
_ILP32
_LFS64_LARGEFILE
And as long as you don't state which compiler you use, it's pretty hard to guess what cpp symbols are defined. gcc has a different set of symbols as HP's C-ANSI-C
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2004 09:28 PM
04-01-2004 09:28 PM
Re: Finding 32 bit or 64
I got it it should be __LP64__ and not LP64
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 2025 Hewlett Packard Enterprise Development LP