Fix windows gnu build.

This commit is contained in:
CrLF0710 2017-04-01 23:14:37 +08:00 committed by Brian Smith
parent a13b8e279e
commit a004549b97
4 changed files with 13 additions and 2 deletions

View File

@ -580,7 +580,7 @@ fn compile(p: &Path, target: &Target, out_dir: &Path,
let mut out_path = out_dir.clone().join(p.file_name().unwrap());
out_path.set_extension(target.obj_ext);
if need_run(&p, &out_path, includes_modified) {
let cmd = if target.env() != "msvc" || ext != "asm" {
let cmd = if target.os() != WINDOWS || ext != "asm" {
cc(p, ext, target, &out_path)
} else {
yasm(p, target.arch(), &out_path)
@ -624,7 +624,7 @@ fn cc(file: &Path, ext: &str, target: &Target, out_dir: &Path) -> Command {
}
if target.os() != "none" &&
target.os() != "redox" &&
target.env() != "msvc" {
target.os() != "windows" {
let _ = c.flag("-fstack-protector");
}

View File

@ -62,11 +62,15 @@
#include <inttypes.h>
#if defined(OPENSSL_WINDOWS)
#if defined(_MSC_VER)
#pragma warning(push, 3)
#endif
#include <immintrin.h>
#include <intrin.h>
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif
#include "internal.h"

View File

@ -27,6 +27,9 @@
/* OS X's C ABI prefixes functions with underscore. */
#define C_ABI(x) _ ## x
#define HIDDEN .private_extern
#elif defined(__MINGW32__) || defined(__MINGW64__)
#define C_ABI(x) x
#define HIDDEN
#else
#define C_ABI(x) x
#define HIDDEN .hidden

View File

@ -45,7 +45,9 @@ long GFp_sysrand_chunk(void *buf, size_t len);
#include <limits.h>
#if defined(_MSC_VER)
#pragma warning(push, 3)
#endif
#include <windows.h>
@ -56,7 +58,9 @@ long GFp_sysrand_chunk(void *buf, size_t len);
#include <ntsecapi.h>
#undef SystemFunction036
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
long GFp_sysrand_chunk(void *out, size_t requested) {
if (requested > ULONG_MAX) {