Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6175861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:59:51+00:00 2026-05-23T23:59:51+00:00

I work on AS/400 which is sometimes non-POSIX. We also need to compile our

  • 0

I work on AS/400 which is sometimes non-POSIX. We also need to compile our code on UNIX. We have an issue with something as simple as #include.

On AS/400, we need to write:

#include "*LIBL/H/MYLIB"

On UNIX, we need to write

#include "MYLIB.H"

At the moment we have this (ugly) block at the top of each C/C++ file:

#ifndef IS_AS400
    #include "*LIBL/H/MYLIB"
    /* others here */
#else
    #include "MYLIB.H"
    /* others here */
#endif

We would like a unified macro. Is this possible? I don’t know how to write it.

Ideally, the resulting syntax would be:

SAFE_INCLUDE("MYLIB")

that would expand correctly on each platform.

Please advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:59:51+00:00Added an answer on May 23, 2026 at 11:59 pm

    You can simply #include some separate header in every of your source files containing that ugly #ifndef just once. It’s a common practice anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Work on this small test application to learn threading/locking. I have the following code,
I work on code something like this ... HEADERS ... int *var; void child()
i am going to work on application which access some files from as/400 server.can
Hi have the following function which works fine: jQuery('.btnRemoveItem').click(function(obj){ jQuery(this).closest('li').fadeOut(400, function() { $(this).remove(); });
I have the following code which toggles the visibility of a div when another
I have an issue i am trying to modify a form's tab order which
work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit
At work, we have migrated from Windows XP to Windows Vista. After the migration,
We have a Git repository with over 400 commits, the first couple dozen of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.