News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How to distinguish betwen Code:Blocks and Visual Studio in code

Started by Borneq, June 13, 2011, 07:53:56 PM

Previous topic - Next topic

Borneq

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 ?

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Borneq

Code:Blocks uses usually GCC. GCC uses snprintf, Visual Studio sprintf_s.
Thanks for http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers

oBFusCATed

C::B can use VC++, no problem (on windows).
VC++ supports snprintf, probably it is called _sntprintf...
(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!]