Permalink
Browse files

More header file portability for Windows.

  • Loading branch information...
1 parent 6596ed7 commit e41e81e8d6847cc378ee2bc2036fbeef8719e747 Brian Ford committed Oct 17, 2010
View
@@ -1,5 +1,7 @@
#include <tr1/unordered_map>
+#include "config.h"
+
#include "util/bert.hpp"
#include "agent_components.hpp"
@@ -1,6 +1,8 @@
/* A BlockEnvironment is created when a block is created. Its primary
* operation is call, which activates the code associated with the block. */
+#include "config.h"
+
#include "builtin/object.hpp"
#include "builtin/symbol.hpp"
@@ -23,6 +25,10 @@
#include "instruments/profiler.hpp"
#include "configuration.hpp"
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#endif
+
#ifdef ENABLE_LLVM
#include "llvm/jit.hpp"
#endif
@@ -1,11 +1,16 @@
+#include "vm/config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <dlfcn.h>
#include <arpa/inet.h>
+#endif
#include "vm.hpp"
#include "oop.hpp"
View
@@ -2,6 +2,8 @@
// because it uses a whole bunch of local classes and it's cleaner to have
// all that be in it's own file.
+#include "vm/config.h"
+
#include "vm/vm.hpp"
#include "gc/gc.hpp"
@@ -21,7 +23,11 @@
#include "object_utils.hpp"
#include <fcntl.h>
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <arpa/inet.h>
+#endif
#include <map>
#include <vector>
View
@@ -1,13 +1,19 @@
+#include "vm/config.h"
+
#include <iostream>
#include <fcntl.h>
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <netdb.h>
+#include <sys/un.h>
+#endif
#include <sys/types.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <netdb.h>
-#include <sys/un.h>
#include "builtin/io.hpp"
#include "builtin/bytearray.hpp"
@@ -1,11 +1,17 @@
/* A simple C++ wrapper around libffi. */
+#include "vm/config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#else
#include <dlfcn.h>
+#endif
#include "prelude.hpp"
#include "object_utils.hpp"
@@ -1,5 +1,6 @@
#include <iostream>
+#include "config.h"
#include "vm.hpp"
#include "exception.hpp"
@@ -26,6 +27,10 @@
#include "capi/capi.hpp"
#include "capi/handle.hpp"
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#endif
+
namespace rubinius {
/** Thread-local NativeMethodEnvironment instance. */
thread::ThreadData<NativeMethodEnvironment*> native_method_environment;
@@ -1,3 +1,5 @@
+#include "vm/config.h"
+
#include "builtin/randomizer.hpp"
#include "vm.hpp"
#include "objectmemory.hpp"
@@ -18,6 +20,11 @@
#include <sys/stat.h>
#include <fcntl.h>
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#include <process.h>
+#endif
+
/*
View
@@ -7,12 +7,15 @@
#include <cstring>
#include <sstream>
+#include "vm/config.h"
+
+#ifndef RBX_WINDOWS
#include <sys/resource.h>
#include <sys/wait.h>
-#include <unistd.h>
#include <pwd.h>
+#endif
+#include <unistd.h>
-#include "config.h"
#include "vm/call_frame.hpp"
#include "vm/helpers.hpp"
View
@@ -1,3 +1,5 @@
+#include "vm/config.h"
+
#include "builtin/array.hpp"
#include "builtin/data.hpp"
#include "builtin/fixnum.hpp"
@@ -27,6 +29,10 @@
#include <vector>
#include <tr1/unordered_map>
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#endif
+
namespace rubinius {
namespace capi {
View
@@ -12,11 +12,16 @@
* call your mother.
*
*/
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <sys/select.h>
+#endif
// A number of extensions expect these to be already included
#include <sys/time.h>
@@ -27,7 +32,6 @@
#include <fcntl.h>
#include <errno.h>
-#include "config.h"
#include "intern.h"
#include "defines.h"
View
@@ -1,3 +1,9 @@
+#include "vm/config.h"
+
+#ifndef RBX_WINDOWS
+#include <sys/select.h>
+#endif
+
#include "capi/capi.hpp"
#include "capi/include/ruby.h"
#include "builtin/thread.hpp"
View
@@ -1,5 +1,6 @@
/* An Environment is the toplevel class for Rubinius. It manages multiple
* VMs, as well as imports C data from the process into Rubyland. */
+#include "config.h"
#include "prelude.hpp"
#include "environment.hpp"
#include "config_parser.hpp"
@@ -37,7 +38,9 @@
#include <fstream>
#include <sstream>
#include <string>
+#ifndef RBX_WINDOWS
#include <sys/utsname.h>
+#endif
#include <fcntl.h>
namespace rubinius {
View
@@ -5,7 +5,12 @@
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
+
+#include "config.h"
+
+#ifndef RBX_WINDOWS
#include <dlfcn.h>
+#endif
#include "vm.hpp"
#include "objectmemory.hpp"
View
@@ -3,14 +3,20 @@
#define _LARGEFILE_SOURCE 1
#define _FILE_OFFSET_BITS 64
+#include "config.h"
+
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <sys/socket.h>
-#include <sys/stat.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netdb.h>
+#endif
+#include <sys/stat.h>
#include <errno.h>
#include <time.h>
View
@@ -1,10 +1,13 @@
+#include "config.h"
#include "global_lock.hpp"
#include "prelude.hpp"
#include "vm.hpp"
#include "builtin/nativemethod.hpp"
+#ifndef RBX_WINDOWS
#include <sched.h>
+#endif
#include <time.h>
#include <sys/time.h>
View
@@ -1,6 +1,7 @@
#include <cstdlib>
#include <iostream>
+#include "config.h"
#include "vm.hpp"
#include "objectmemory.hpp"
#include "gc/marksweep.hpp"
View
@@ -1,6 +1,8 @@
#ifndef RBX_SHARED_STATE_H
#define RBX_SHARED_STATE_H
+#include "config.h"
+
#include "util/refcount.hpp"
#include "global_lock.hpp"
#include "maps.hpp"
@@ -16,6 +18,10 @@
#include "primitives.hpp"
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#endif
+
namespace rubinius {
namespace capi {
class Handles;
View
@@ -1,12 +1,15 @@
+#include "config.h"
#include "signal.hpp"
#include "vm.hpp"
#include "native_thread.hpp"
#include "builtin/module.hpp"
#include <iostream>
-#include <sys/select.h>
#include <fcntl.h>
+#ifndef RBX_WINDOWS
+#include <sys/select.h>
+#endif
namespace rubinius {
struct CallFrame;
View
@@ -5,7 +5,9 @@
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
-#ifndef RBX_WINDOWS
+#ifdef RBX_WINDOWS
+#include <winsock2.h>
+#else
#include <arpa/inet.h>
#endif
#include <string.h>
View
@@ -6,10 +6,6 @@
/*------------------------------ internal #includes ---------------------- */
-#ifdef WIN32
-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
-#endif /* WIN32 */
-
#include <stdio.h> /* for printing in malloc_stats */
#ifndef LACKS_ERRNO_H
View
@@ -9,7 +9,9 @@
#include <list>
#include <vector>
+#ifndef RBX_WINDOWS
#include <sys/mman.h>
+#endif
namespace immix {
View
@@ -34,7 +34,9 @@
#include <iostream>
#include <iomanip>
#include <signal.h>
+#ifndef RBX_WINDOWS
#include <sys/resource.h>
+#endif
// Reset macros since we're inside state
#undef G
View
@@ -1,3 +1,4 @@
+#include "config.h"
#include "arguments.hpp"
#include "dispatch.hpp"
#include "call_frame.hpp"
@@ -19,13 +20,16 @@
#include "instruments/profiler.hpp"
#include "instruments/timing.hpp"
-#include "config.h"
#include "raise_reason.hpp"
#include "inline_cache.hpp"
#include "configuration.hpp"
+#ifdef RBX_WINDOWS
+#include <malloc.h>
+#endif
+
#ifdef ENABLE_LLVM
#include "llvm/jit.hpp"
#endif

0 comments on commit e41e81e

Please sign in to comment.