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 9031305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:41:55+00:00 2026-06-16T07:41:55+00:00

It is possible how I can determine OS and OS version in preprocessor? I

  • 0

It is possible how I can determine OS and OS version in preprocessor?

I want to devide Solaris 10 and other OS’s.

  • 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-06-16T07:41:56+00:00Added an answer on June 16, 2026 at 7:41 am

    Like Jan Dvorak said, this depends on whether you’re referring to the host system (the one you’re compiling on) or the target system (the one your application will run on).

    If the latter, there is no way to do what you want for the simple reason that this information is only available at runtime on the target system, while the preprocessor runs during compilation only.

    If the former, your compiler should make available pre-defined MACROS that will give you some information about the system you’re compiling on. For example, when compiling using MingW or MSVC on Windows the _WIN32 macro will be defined to allow you to conditionally include code.

    However, this is unlikely to give you the information you seek because the OS version is usually irrelevant during compilation – the information you want is which OS you are compiling on (e.g.: Windows, Solaris), which compiler version, etc.

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

Sidebar

Related Questions

Possible Duplicate: Determine Browser’s Version I want to determine the browser type in the
Possible Duplicate: How can I determine installed SQL Server instances and their versions? i've
Possible Duplicate: Can we use any other TAG inside <ul> along with <li>? Or
In ASP.NET MVC, is it possible to define routes that can determine which controller
Possible Duplicate: How can I determine the direction of a jQuery scroll event? I
Possible Duplicate: How can I determine if a python script is executed from crontab?
Possible Duplicate: Finding the version of OSX inside java I want to check the
while using database under MySQL how can i determine my current MySQL version,database name
Is it possible to determine the HTTP protocol version (e.g. 1.0 vs. 1.1) used
Possible Duplicate: Validate HWND using Win32 API How can I determent if the window

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.