diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-04 17:15:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-04 17:15:08 +0100 |
commit | 244d22a3d27b303d44f59296a19dc4cb31fd429d (patch) | |
tree | dfcb7b4b137bdd583783c3c9ee73e1e8d3844f69 /sal | |
parent | 9055fb48402eaeb9ba876b7893e2f9a39fea06b1 (diff) |
Work around -Werror,-Wunused-macros with clang-cl
clang-cl as-is does not provide the intrinsics provided by MSVC; you need to
explicitly include Intrin.h (provided by clang) for that. So, as a hack,
specify CC/CXX as
clang-cl.exe -FIIntrin.h ...
to have the intrinsics always available. But Intrin.h includes stdlib.h, so by
the time sal/osl/w32/random.c defines _CRT_RAND_S before including stdlib.h, the
latter has already been included without _CRT_RAND_S support. So, as a second
hack, specify CC rather as
clang-cl.exe -D_CRT_RAND_S= -FIIntrin.h ...
But then clang-cl starts to emit -Werror,-Wunused-macros, as defining
_CRT_RAND_S in the main file has no effect here.
Change-Id: I5dfe9872dea7e8eb476d9260f17ab8d8893f48af
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/random.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sal/osl/w32/random.c b/sal/osl/w32/random.c index 78ea5bfae27f..d394f19a03af 100644 --- a/sal/osl/w32/random.c +++ b/sal/osl/w32/random.c @@ -6,7 +6,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#if !defined _CRT_RAND_S #define _CRT_RAND_S +#endif #include <stdlib.h> #include <memory.h> |