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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:45:06+00:00 2026-05-11T22:45:06+00:00

I am writing a program that is cross platform. There are a few spots

  • 0

I am writing a program that is cross platform. There are a few spots where I have to specify an operating system dependent call.

#ifdef WINDOWS
..do windows only stuff
#endif
#ifdef LINUX
..do linux only stuff    
#endif

Are there any preprocesser directives that get defined by the compiler so I don’t have to explicitly define them when I use the command line compiler. ie.

cl -DWINDOWS program.cpp

or

g++ -DLINUX program.cpp

I realize I could easily write a makefile or have a shell/batch script that will do this automatically. But I would prefer to use the same ones as the compiler (if they exist) by default.

  • 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-11T22:45:06+00:00Added an answer on May 11, 2026 at 10:45 pm

    I found a complete list for all g++’s on this website.

    • #define __HAVE_BUILTIN_SETJMP__ 1
    • #define __unix__ 1
    • #define unix 1
    • #define __i386__ 1
    • #define __SIZE_TYPE__ unsigned int
    • #define __ELF__ 1
    • #define __GNUC_PATCHLEVEL__ 3
    • #define __linux 1
    • #define __unix 1
    • #define __linux__ 1
    • #define __USER_LABEL_PREFIX__
    • #define linux 1
    • #define __STDC_HOSTED__ 1
    • #define __EXCEPTIONS 1
    • #define __GXX_WEAK__ 1
    • #define __WCHAR_TYPE__ long int
    • #define __gnu_linux__ 1
    • #define __WINT_TYPE__ unsigned int
    • #define __GNUC__ 3
    • #define __cplusplus 1
    • #define __DEPRECATED 1
    • #define __GNUG__ 3
    • #define __GXX_ABI_VERSION 102
    • #define i386 1
    • #define __GNUC_MINOR__ 2
    • #define __STDC__ 1
    • #define __PTRDIFF_TYPE__ int
    • #define __tune_i386__ 1
    • #define __REGISTER_PREFIX__
    • #define __NO_INLINE__ 1
    • #define _GNU_SOURCE 1
    • #define __i386 1
    • #define __VERSION__ "3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)"

    And Visual C++ already has Win32 defined to use for any Widnows version.

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

Sidebar

Ask A Question

Stats

  • Questions 165k
  • Answers 165k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Categories extend the original class, but they don't subclass it,… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer Haven't tested this, but it's something like: RewriteRule \.php$ -… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer "0:0:0:0:0:0:0:1" is the IPv6 loopback address as defined in RFC… May 12, 2026 at 12:54 pm

Related Questions

I'm writing a program that needs to take input from an XBox 360 controller.
I am writing a fairly large and complex data analysis program and I have
I am writing a program that is meant to be extended by some function
Dear all, I am writing a python program that is retrieving edifact log messages

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.