From 8e204b2d677c258ee64510ee7e1363371a8f5ce8 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Wed, 10 May 2017 16:52:50 +0300 Subject: [PATCH] =?utf8?q?[lumped=20builds]=20Only=20define=20=5FCRT=5FSEC?= =?utf8?q?URE=5FNO=5FWARNINGS=20if=20it=E2=80=99s=20not=20defined=20yet.?= =?utf8?q?=20When=20glslang=20is=20built=20with=20some=20other=20build=20s?= =?utf8?q?ystem=20and=20lumped/unity=20builds=20are=20used,=20without=20th?= =?utf8?q?e=20checks=20this=20would=20get=20=E2=80=9Cmacro=20is=20being=20?= =?utf8?q?redefined=E2=80=9D=20warnings/errors.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- StandAlone/StandAlone.cpp | 2 ++ glslang/MachineIndependent/preprocessor/Pp.cpp | 2 ++ glslang/MachineIndependent/preprocessor/PpAtom.cpp | 2 ++ glslang/MachineIndependent/preprocessor/PpScanner.cpp | 2 ++ glslang/MachineIndependent/preprocessor/PpTokens.cpp | 4 +++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 3faadec..76af8fe 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -35,7 +35,9 @@ // // this only applies to the standalone wrapper, not the front end in general +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include "ResourceLimits.h" #include "Worklist.h" diff --git a/glslang/MachineIndependent/preprocessor/Pp.cpp b/glslang/MachineIndependent/preprocessor/Pp.cpp index e71e79c..293ada6 100644 --- a/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include diff --git a/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/glslang/MachineIndependent/preprocessor/PpAtom.cpp index 52df3b0..06c2333 100644 --- a/glslang/MachineIndependent/preprocessor/PpAtom.cpp +++ b/glslang/MachineIndependent/preprocessor/PpAtom.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include diff --git a/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/glslang/MachineIndependent/preprocessor/PpScanner.cpp index e72efc0..cee45ce 100644 --- a/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include diff --git a/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 7fa06a5..4baf99e 100644 --- a/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -80,8 +80,10 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // For recording and playing back the stream of tokens in a macro definition. // -#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif +#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) #define snprintf sprintf_s #endif -- 2.7.4