Code::Blocks Forums
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
As usual while waiting for the next release - don't forget to check the
nightly builds
in the forum.
Home
Help
Search
Login
Register
Code::Blocks Forums
»
User forums
»
Using Code::Blocks
»
How to distinguish betwen Code:Blocks and Visual Studio in code
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: How to distinguish betwen Code:Blocks and Visual Studio in code (Read 5832 times)
Borneq
Multiple posting newcomer
Posts: 45
How to distinguish betwen Code:Blocks and Visual Studio in code
«
on:
June 13, 2011, 07:53:56 pm »
I want to compile code under Code:Blocks as well as under Visual Studio. Is problem: Code:Blocks uses snprintf only whereas Visual Studio only sprintf_s (will be well if Code:Blocks uses both).
How distinguish betwen Code:Blocks and Visual Studio ? Is any conditional? How to list all conditionals like _WIN32 ?
Logged
stahta01
Lives here!
Posts: 7790
Re: How to distinguish betwen Code:Blocks and Visual Studio in code
«
Reply #1 on:
June 13, 2011, 08:07:20 pm »
Code::Blocks IS NOT a Compiler.
Read the FAQs
http://wiki.codeblocks.org/index.php?title=FAQ
http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
Tim S.
Logged
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ.
http://wiki.codeblocks.org
Borneq
Multiple posting newcomer
Posts: 45
Re: How to distinguish betwen Code:Blocks and Visual Studio in code
«
Reply #2 on:
June 14, 2011, 12:32:21 pm »
Code:Blocks uses usually GCC. GCC uses snprintf, Visual Studio sprintf_s.
Thanks for
http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
«
Last Edit: June 14, 2011, 12:33:58 pm by Borneq
»
Logged
oBFusCATed
Developer
Lives here!
Posts: 13406
Re: How to distinguish betwen Code:Blocks and Visual Studio in code
«
Reply #3 on:
June 14, 2011, 01:29:51 pm »
C::B can use VC++, no problem (on windows).
VC++ supports snprintf, probably it is called _sntprintf...
Logged
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
Code::Blocks Forums
»
User forums
»
Using Code::Blocks
»
How to distinguish betwen Code:Blocks and Visual Studio in code