Commit bf630e23 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix MinGW-w64 GCC 4.7 compilation

Contributed by net147@gmail.com

BUGS=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10019012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ac72f5c4
...@@ -51,6 +51,22 @@ int strncasecmp(const char* s1, const char* s2, int n) { ...@@ -51,6 +51,22 @@ int strncasecmp(const char* s1, const char* s2, int n) {
// the Microsoft Visual Studio C++ CRT. // the Microsoft Visual Studio C++ CRT.
#ifdef __MINGW32__ #ifdef __MINGW32__
#ifndef __MINGW64_VERSION_MAJOR
#define _TRUNCATE 0
#define STRUNCATE 80
inline void MemoryBarrier() {
int barrier = 0;
__asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
}
#endif // __MINGW64_VERSION_MAJOR
#ifndef MINGW_HAS_SECURE_API
int localtime_s(tm* out_tm, const time_t* time) { int localtime_s(tm* out_tm, const time_t* time) {
tm* posix_local_time_struct = localtime(time); tm* posix_local_time_struct = localtime(time);
if (posix_local_time_struct == NULL) return 1; if (posix_local_time_struct == NULL) return 1;
...@@ -64,13 +80,6 @@ int fopen_s(FILE** pFile, const char* filename, const char* mode) { ...@@ -64,13 +80,6 @@ int fopen_s(FILE** pFile, const char* filename, const char* mode) {
return *pFile != NULL ? 0 : 1; return *pFile != NULL ? 0 : 1;
} }
#ifndef __MINGW64_VERSION_MAJOR
#define _TRUNCATE 0
#define STRUNCATE 80
#endif // __MINGW64_VERSION_MAJOR
int _vsnprintf_s(char* buffer, size_t sizeOfBuffer, size_t count, int _vsnprintf_s(char* buffer, size_t sizeOfBuffer, size_t count,
const char* format, va_list argptr) { const char* format, va_list argptr) {
ASSERT(count == _TRUNCATE); ASSERT(count == _TRUNCATE);
...@@ -104,16 +113,7 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) { ...@@ -104,16 +113,7 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) {
return 0; return 0;
} }
#endif // MINGW_HAS_SECURE_API
#ifndef __MINGW64_VERSION_MAJOR
inline void MemoryBarrier() {
int barrier = 0;
__asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
}
#endif // __MINGW64_VERSION_MAJOR
#endif // __MINGW32__ #endif // __MINGW32__
......
...@@ -264,6 +264,7 @@ TEST(DisasmX64) { ...@@ -264,6 +264,7 @@ TEST(DisasmX64) {
ExternalReference after_break_target = ExternalReference after_break_target =
ExternalReference(Debug_Address::AfterBreakTarget(), ExternalReference(Debug_Address::AfterBreakTarget(),
assm.isolate()); assm.isolate());
USE(after_break_target);
#endif // ENABLE_DEBUGGER_SUPPORT #endif // ENABLE_DEBUGGER_SUPPORT
__ jmp(ic, RelocInfo::CODE_TARGET); __ jmp(ic, RelocInfo::CODE_TARGET);
__ nop(); __ nop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment