Author Topic: [SOLVED] #ifdef _WIN32 is true for a Linux project (Slickedit 15.0.0.5)  (Read 5165 times)

colonel_coder

  • Community Member
  • Posts: 49
  • Hero Points: 1
I am porting some code from a Windows project to a Linux project.  I am using code like this
Code: [Select]
#ifdef _WIN32
    // Original code
#else // !_WIN32
    // Linux code
#endif // _WIN32
to control the changes.  However, even though I have defined a new compiler and run the "generate-g++-header.sh" script from

    "C:\Program Files\SlickEditV15.0.0\sysconfig\vsparser"

Slickedit still thinks _WIN32 is defined.

How do I fix this?

Along with _WIN32, there are a lot of other Windows specific definitions in [Tools]->[Options...]->[Languages]->[Application Languages]->[C/C++ Preprocessing].  Is this because I am running the Windows version of Slickedit?
« Last Edit: June 29, 2010, 11:39:23 pm by colonel_coder »

colonel_coder

  • Community Member
  • Posts: 49
  • Hero Points: 1
Re: #ifdef _WIN32 is true for a Linux project (Slickedit 15.0.0.5)
« Reply #1 on: June 23, 2010, 08:51:45 pm »
Follow up
_UNICODE is listed as having the "undef" box checked, but it also has no value.  _WIN32 has a value of "1".  Does the value override the "undef" check box setting?

colonel_coder

  • Community Member
  • Posts: 49
  • Hero Points: 1
Re: #ifdef _WIN32 is true for a Linux project (Slickedit 15.0.0.5)
« Reply #2 on: June 23, 2010, 09:26:48 pm »
Follow up #2
I just made a screen capture of Slickedit coloring two different sections of code differently even though they both are conditional on "#ifdef _WIN32".

colonel_coder

  • Community Member
  • Posts: 49
  • Hero Points: 1
Re: #ifdef _WIN32 is true for a Linux project (Slickedit 15.0.0.5)
« Reply #3 on: June 29, 2010, 11:38:54 pm »
This problem can be solved by selecting [Tools]->[Options...]->[Languages]->[Application Languages]->[C/C++]->[C/C++ Preprocessing] and

  • Unchecking "undef" for _WIN32
  • Removing the "1" from the "_WIN32"
  • Checking "undef" for _WIN32