473,473 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Detecting the gcc version in the source code

Hi ,
I am writing code that makes use of certain C++ STL features (ex
hash_map) and their usage is slightly different between versions<3.3
and versions beyond 3.3 ,such as which file to include (ext/hash_map
or hash_map ) and whether to define the __gnu_cxx namespace. I want to
be able to detect using a macro (preferably ) which g++ version I am
using and write code for accordingly ..Is this possible.
Vivek
Jul 22 '05 #1
1 2806
Vivek Krishna wrote:
Hi ,
I am writing code that makes use of certain C++ STL features (ex
hash_map) and their usage is slightly different between versions<3.3
and versions beyond 3.3 ,such as which file to include (ext/hash_map
or hash_map ) and whether to define the __gnu_cxx namespace. I want to
be able to detect using a macro (preferably ) which g++ version I am
using and write code for accordingly ..Is this possible.
Vivek


First of all, you're off-topic in comp.lang.c++ (dunno about the other
group). This question would rather belong in gnu.g++.help. And then yes, of
course you can find out the version. On a un*x system, do:

echo | g++ -E -x c++ -dm -

and you'll see a list of all pre-defined macros. I can see things like:

#define __GNUC__ 3
#define __GNUC_MINOR__ 3
#define __GNUC_PATCHLEVEL__ 3
#define __VERSION__ "3.3.3"

in that output.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: H | last post by:
Hi All, Is it possible to detect a users regional settings, in particular - Currency? Thanks! Hellen.
4
by: Michael Albanese | last post by:
I am trying to build a user control that will allow a user to select a date from a calendar. I have to code that will run on the calendar's SelectionChanged event, but i am at a loss to return the...
3
by: Ricardo Garcia | last post by:
hi, i was just wondering about javascript version i used to do it putting in the <head>: <script type="text/javascript"> jsver = "1.0"; </script> <script language="JavaScript1.1"> jsver =...
5
by: Christoffer Soerensen | last post by:
Hi, I am currently building an application in C# using mono and .NET. I want to get a MIME type for a specific file, which is why I want to detect the OS on which the application is running. On...
3
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
8
by: dwelch91 | last post by:
I need to detect whether the operating system I am running on (not the Python version) is 64bit or 32bit. One requirement is that I need to include support for non-Intel/AMD architectures. The 2...
13
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure....
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.