LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2009, 10:48 PM   #1
Bassy
Member
 
Registered: Oct 2004
Location: Venezuela
Distribution: Open SuSE v.-11.1.
Posts: 36

Rep: Reputation: 15
Question OS Validation on C++


Hey buddies!

Simple question?

How can I write a C++ code that knows in which OS is it running?

I mean, how can I validate this?

 
Old 04-16-2009, 11:53 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
The simplest way is to use OS-specific predefined macros
http://predef.sourceforge.net/
 
Old 04-17-2009, 12:31 AM   #3
Bassy
Member
 
Registered: Oct 2004
Location: Venezuela
Distribution: Open SuSE v.-11.1.
Posts: 36

Original Poster
Rep: Reputation: 15
Nice!

I made my macros for it!

Thanks for the tip!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU Validation nolinuxnollife Linux - Desktop 5 10-06-2007 08:14 AM
xml validation kshkid Programming 1 05-02-2007 01:46 AM
terminal validation xviddivxoggmp3 Red Hat 5 03-13-2007 12:44 PM
Need Your Validation scbops Linux - Newbie 1 12-27-2006 05:09 AM
Validation Makaveli.2003 Programming 1 05-06-2002 08:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration