Author Topic: preprocessor settings  (Read 22782 times)

Offline mikethebike

  • Multiple posting newcomer
  • *
  • Posts: 24
    • Homepage
preprocessor settings
« on: April 05, 2009, 02:11:11 pm »
Hi
where do I have to put this from MS in codeblocks?:
------------
 In the MS compiler project settiings add this to the end of the preprocessor definitions in the C/C++ General tab.

    ,IBM=1
--------------
Thanks
Michael

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: preprocessor settings
« Reply #1 on: April 05, 2009, 02:41:31 pm »
Hi
where do I have to put this from MS in codeblocks?:
------------
 In the MS compiler project settiings add this to the end of the preprocessor definitions in the C/C++ General tab.

    ,IBM=1
--------------
Thanks
Michael


In projects build options -> Compiler settings -> #definitions.
Just add IBM=1.

By the way if you don't add the "=1" it should be enough. "Empty" definitions normally get initiated with "1" (might depend on the compiler).

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: preprocessor settings
« Reply #2 on: April 05, 2009, 03:15:58 pm »
Quote from: Jens
By the way if you don't add the "=1" it should be enough. "Empty" definitions normally get initiated with "1" (might depend on the compiler).

Empty definitions should be empty. The only part of the standard that says anything about macros getting a value is when you use an #if statement with an undefined macro, then their value is 0. However, it is a macro definition through the command line, so it may have another behavior. Better to be explicit, I'd say.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: preprocessor settings
« Reply #3 on: April 05, 2009, 03:42:48 pm »
Quote from: Jens
By the way if you don't add the "=1" it should be enough. "Empty" definitions normally get initiated with "1" (might depend on the compiler).

Empty definitions should be empty. The only part of the standard that says anything about macros getting a value is when you use an #if statement with an undefined macro, then their value is 0. However, it is a macro definition through the command line, so it may have another behavior. Better to be explicit, I'd say.

Quote from: gcc-documentation
-D name
    Predefine name as a macro, with definition 1.

It was only meant for defines from command-line (my post was not clear about that, sorry) and as I wrote:
... (might depend on the compiler).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: preprocessor settings
« Reply #4 on: April 06, 2009, 09:29:13 am »
In the MS compiler project settiings add this to the end of the preprocessor definitions in the C/C++ General tab.
    ,IBM=1
Reads like the X-Plane SDK to me... I have had my fun coding with it... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ