Commit 50f3a993 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Fix compilation with recent MinGW64 versions.

Don't check for WIN32 define. Use V8_OS_* macros whenever
possible, and if not use _WIN32.

BUG=v8:2300
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/23687003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4f60ee6b
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#ifndef WIN32
#include <stdint.h>
#endif
#include "v8.h" #include "v8.h"
......
...@@ -123,10 +123,6 @@ namespace internal { ...@@ -123,10 +123,6 @@ namespace internal {
STATEMENT_NODE_LIST(V) \ STATEMENT_NODE_LIST(V) \
EXPRESSION_NODE_LIST(V) EXPRESSION_NODE_LIST(V)
#ifdef WIN32
#undef Yield
#endif
// Forward declarations // Forward declarations
class AstConstructionVisitor; class AstConstructionVisitor;
template<class> class AstNodeFactory; template<class> class AstNodeFactory;
......
...@@ -620,7 +620,7 @@ DEFINE_int(testing_int_flag, 13, "testing_int_flag") ...@@ -620,7 +620,7 @@ DEFINE_int(testing_int_flag, 13, "testing_int_flag")
DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_float(testing_float_flag, 2.5, "float-flag")
DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
#ifdef WIN32 #ifdef _WIN32
DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
"file in which to testing_serialize heap") "file in which to testing_serialize heap")
#else #else
......
...@@ -1872,7 +1872,7 @@ static void DestroyCodeEntry(JITCodeEntry* entry) { ...@@ -1872,7 +1872,7 @@ static void DestroyCodeEntry(JITCodeEntry* entry) {
static void RegisterCodeEntry(JITCodeEntry* entry, static void RegisterCodeEntry(JITCodeEntry* entry,
bool dump_if_enabled, bool dump_if_enabled,
const char* name_hint) { const char* name_hint) {
#if defined(DEBUG) && !defined(WIN32) #if defined(DEBUG) && !V8_OS_WIN
static int file_num = 0; static int file_num = 0;
if (FLAG_gdbjit_dump && dump_if_enabled) { if (FLAG_gdbjit_dump && dump_if_enabled) {
static const int kMaxFileNameSize = 64; static const int kMaxFileNameSize = 64;
......
...@@ -711,7 +711,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { ...@@ -711,7 +711,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
// position registers. // position registers.
__ mov(Operand(ebp, kInputStartMinusOne), eax); __ mov(Operand(ebp, kInputStartMinusOne), eax);
#ifdef WIN32 #if V8_OS_WIN
// Ensure that we write to each stack page, in order. Skipping a page // Ensure that we write to each stack page, in order. Skipping a page
// on Windows can cause segmentation faults. Assuming page size is 4k. // on Windows can cause segmentation faults. Assuming page size is 4k.
const int kPageSize = 4096; const int kPageSize = 4096;
...@@ -721,7 +721,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { ...@@ -721,7 +721,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
i += kRegistersPerPage) { i += kRegistersPerPage) {
__ mov(register_location(i), eax); // One write every page. __ mov(register_location(i), eax); // One write every page.
} }
#endif // WIN32 #endif // V8_OS_WIN
Label load_char_start_regexp, start_regexp; Label load_char_start_regexp, start_regexp;
// Load newline if index is at start, previous character otherwise. // Load newline if index is at start, previous character otherwise.
......
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#ifndef WIN32
#include <stdint.h>
#endif
#include "v8.h" #include "v8.h"
......
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
#ifndef V8_PLATFORM_H_ #ifndef V8_PLATFORM_H_
#define V8_PLATFORM_H_ #define V8_PLATFORM_H_
#include <cstdarg>
#include "lazy-instance.h"
#include "utils.h"
#include "v8globals.h"
#ifdef __sun #ifdef __sun
# ifndef signbit # ifndef signbit
namespace std { namespace std {
...@@ -55,19 +61,12 @@ int signbit(double x); ...@@ -55,19 +61,12 @@ int signbit(double x);
// GCC specific stuff // GCC specific stuff
#ifdef __GNUC__ #ifdef __GNUC__
// Needed for va_list on at least MinGW and Android.
#include <stdarg.h>
#define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) #define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
#endif // __GNUC__ #endif // __GNUC__
// Windows specific stuff.
#ifdef WIN32
// Microsoft Visual C++ specific stuff. // Microsoft Visual C++ specific stuff.
#ifdef _MSC_VER #if V8_CC_MSVC
#include "win32-headers.h" #include "win32-headers.h"
#include "win32-math.h" #include "win32-math.h"
...@@ -76,7 +75,7 @@ int strncasecmp(const char* s1, const char* s2, int n); ...@@ -76,7 +75,7 @@ int strncasecmp(const char* s1, const char* s2, int n);
inline int lrint(double flt) { inline int lrint(double flt) {
int intgr; int intgr;
#if defined(V8_TARGET_ARCH_IA32) #if V8_TARGET_ARCH_IA32
__asm { __asm {
fld flt fld flt
fistp intgr fistp intgr
...@@ -91,18 +90,12 @@ inline int lrint(double flt) { ...@@ -91,18 +90,12 @@ inline int lrint(double flt) {
return intgr; return intgr;
} }
#endif // _MSC_VER #endif // V8_CC_MSVC
#ifndef __CYGWIN__
// Random is missing on both Visual Studio and MinGW. // Random is missing on both Visual Studio and MinGW.
#if V8_CC_MSVC || V8_CC_MINGW
int random(); int random();
#endif #endif // V8_CC_MSVC || V8_CC_MINGW
#endif // WIN32
#include "lazy-instance.h"
#include "utils.h"
#include "v8globals.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -104,11 +104,6 @@ class DuplicateFinder { ...@@ -104,11 +104,6 @@ class DuplicateFinder {
}; };
#ifdef WIN32
#undef Yield
#endif
class PreParser { class PreParser {
public: public:
enum PreParseResult { enum PreParseResult {
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#undef USING_V8_SHARED #undef USING_V8_SHARED
#include "../include/v8.h" #include "../include/v8.h"
#ifdef WIN32 #if V8_OS_WIN
#include <windows.h> // NOLINT #include "win32-headers.h"
extern "C" { extern "C" {
BOOL WINAPI DllMain(HANDLE hinstDLL, BOOL WINAPI DllMain(HANDLE hinstDLL,
...@@ -41,4 +41,4 @@ BOOL WINAPI DllMain(HANDLE hinstDLL, ...@@ -41,4 +41,4 @@ BOOL WINAPI DllMain(HANDLE hinstDLL,
return TRUE; return TRUE;
} }
} }
#endif #endif // V8_OS_WIN
...@@ -96,3 +96,4 @@ ...@@ -96,3 +96,4 @@
#undef GetObject #undef GetObject
#undef CreateMutex #undef CreateMutex
#undef CreateSemaphore #undef CreateSemaphore
#undef Yield
...@@ -761,7 +761,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -761,7 +761,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// position registers. // position registers.
__ movq(Operand(rbp, kInputStartMinusOne), rax); __ movq(Operand(rbp, kInputStartMinusOne), rax);
#ifdef WIN32 #if V8_OS_WIN
// Ensure that we have written to each stack page, in order. Skipping a page // Ensure that we have written to each stack page, in order. Skipping a page
// on Windows can cause segmentation faults. Assuming page size is 4k. // on Windows can cause segmentation faults. Assuming page size is 4k.
const int kPageSize = 4096; const int kPageSize = 4096;
...@@ -771,7 +771,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -771,7 +771,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
i += kRegistersPerPage) { i += kRegistersPerPage) {
__ movq(register_location(i), rax); // One write every page. __ movq(register_location(i), rax); // One write every page.
} }
#endif // WIN32 #endif // V8_OS_WIN
// Initialize code object pointer. // Initialize code object pointer.
__ Move(code_object_pointer(), masm_.CodeObject()); __ Move(code_object_pointer(), masm_.CodeObject());
......
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <limits.h> #include <climits>
#include <csignal>
#ifndef WIN32
#include <signal.h> // kill
#include <unistd.h> // getpid
#endif // WIN32
#include <string> #include <string>
#include <map> #include <map>
#include "v8.h" #include "v8.h"
#if V8_OS_POSIX
#include <unistd.h> // NOLINT
#endif
#include "api.h" #include "api.h"
#include "arguments.h" #include "arguments.h"
#include "cctest.h" #include "cctest.h"
...@@ -20031,7 +20031,7 @@ THREADED_TEST(JSONParseNumber) { ...@@ -20031,7 +20031,7 @@ THREADED_TEST(JSONParseNumber) {
} }
#ifndef WIN32 #if V8_OS_POSIX
class ThreadInterruptTest { class ThreadInterruptTest {
public: public:
ThreadInterruptTest() : sem_(NULL), sem_value_(0) { } ThreadInterruptTest() : sem_(NULL), sem_value_(0) { }
...@@ -20273,4 +20273,4 @@ TEST(AccessCheckThrows) { ...@@ -20273,4 +20273,4 @@ TEST(AccessCheckThrows) {
v8::V8::SetFailedAccessCheckCallbackFunction(NULL); v8::V8::SetFailedAccessCheckCallbackFunction(NULL);
} }
#endif // WIN32 #endif // V8_OS_POSIX
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