User forums > Help

# if _MSC_VER >= 1400

(1/2) > >>

visir:
Just found this in one program


--- Code: ---#  if _MSC_VER >= 1400
_sopen_s(&handle, filepath, mod | opt, (dolock ? ((mod == O_RDONLY) ? _SH_DENYRD : _SH_DENYRW) : _SH_DENYNO), _S_IREAD | _S_IWRITE);
#  else
handle = _sopen (filepath, mod | opt, (dolock ? ((mod == O_RDONLY) ? _SH_DENYRD : _SH_DENYRW) : _SH_DENYNO), _S_IREAD | _S_IWRITE);
#  endif
--- End code ---

codeblocks highlights the first part, while debugger stops at the second one. The "_MSC_VER >= 1400" seems to mean "visual studio 2005 or older". But I'm actually using msys2. This change has this comment: "fixed all VS2005 deprecated function warnings".

What should I do with this thing, any suggestions?

oBFusCATed:
Disable the editor feature that greys out preprocessor directives...

visir:
That is indeed a suggestion, but...

Let's just chat about something. About, dunno, microsoft, preprocessor.

oBFusCATed:
Chat about what? The editor doesn't know about defines from project/compiler settings, neither it knows about compiler built-in defines.
Until someone implement this, it is best to just disable this feature. And btw this is not the first time some one is complaining about this.

visir:
Hm...

Any way to print out the value of _MSC_VER? Compiler probably defines it in the headers somewhere, I need to find out the exact value and copy it into #defines in project options.

Navigation

[0] Message Index

[#] Next page

Go to full version