Opened 15 years ago

Closed 14 years ago

#1768 closed Bugs (fixed)

system: error_code.cpp #defines macros without checking whether already defined

Reported by: Mat Marcus Owned by: Beman Dawes
Milestone: Boost 1.36.0 Component: system
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc:

Description

error_code.cpp contains the following #defines:

#define _CRT_SECURE_NO_DEPRECATE #define _SCL_SECURE_NO_DEPRECATE

It should first check that these macros are not defined already. Otherwise users who #define these macros on the command line will received duplicate definition errors, as I am. Also, you might consider adding:

#define _SECURE_SCL 0

for VC 9.

Change History (2)

comment:1 by Mat Marcus, 15 years ago

Actually, a short term fix (e.g. for possible 1.35.1) keeping the current semantics, but avoiding errors for those errors who define this flag globally via the command line of their build system, might be to replace: #define _CRT_SECURE_NO_DEPRECATE #define _SCL_SECURE_NO_DEPRECATE with #define _CRT_SECURE_NO_DEPRECATE 1 #define _SCL_SECURE_NO_DEPRECATE 1

comment:2 by Beman Dawes, 14 years ago

Resolution: fixed
Status: newclosed

Fixed by including <boost/config/warning_disable.hpp>

Note: See TracTickets for help on using tickets.