Permalink
Browse files

Remove last vestage of cinvoke, add our own endian detection

  • Loading branch information...
1 parent d492a25 commit 4dfac3d9fa62700214850bbd82ee1f96dd3000e6 @evanphx evanphx committed Nov 18, 2007
View
@@ -60,7 +60,8 @@ shotgun/rubinius.bin
shotgun/config.h
shotgun/.libs
shotgun/config.mk
-shotgun/config/is64bit
+shotgun/config/*
+!shotgun/config/*.c
shotgun/lib/librubinius.*
shotgun/lib/librubinius-*
@@ -0,0 +1,7 @@
+int main(int argc, char **argv) {
+ char *data = "\x12\x34\x56\x78";
+ int *idata = (int*)data;
+
+ /* 0 is false to C, but true to shell. I hate unix sometimes. */
+ return !(*idata == 0x12345678);
+}
@@ -323,7 +323,7 @@ OBJECT cpu_compile_method(STATE, OBJECT cm) {
/* If this is not a big endian platform, we need to adjust
the iseq to have the right order */
-#if !defined(__BIG_ENDIAN__)
+#if !CONFIG_BIG_ENDIAN
iseq_flip(state, ba);
#endif
View
@@ -780,7 +780,7 @@ void machine_setup_config(machine m) {
machine_set_const_under(m, "COMPILER", SYM("unknown"), mod);
#endif
-#if defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
+#if CONFIG_BIG_ENDIAN
machine_set_const_under(m, "ENDIAN", SYM("big"), mod);
#else
machine_set_const_under(m, "ENDIAN", SYM("little"), mod);
View
@@ -2540,18 +2540,6 @@ def iseq_compile
<<-CODE
self = stack_pop();
/*
- printf("Compiling iseq %p...\\n", self);
- if(self->IsLittleEndian) {
- #if defined(__BIG_ENDIAN__)
- printf("flip1\\n");
- iseq_flip(state, self);
- #endif
- } else {
- #if !defined(__BIG_ENDIAN__)
- printf("flip2\\n");
- iseq_flip(state, self);
- #endif
- }
*/
stack_push(Qtrue);
CODE
@@ -1,10 +1,6 @@
#include "shotgun.h"
#include "nmc.h"
-#ifdef USE_CINVOKE
-#include <cinvoke.h>
-#endif
-
#include "ltdl.h"
void subtend_setup_global();
@@ -21,9 +17,6 @@ void subtend_setup(STATE) {
BASIC_CLASS(nmethod) = rbs_class_new(state, "NativeMethod", 0, BASIC_CLASS(cmethod));
lt_dlinit();
-#ifdef USE_CINVOKE
- state->c_context = cinv_context_create();
-#endif
subtend_setup_global();
state->handle_tbl = handle_table_new();
View
@@ -75,3 +75,8 @@ else
echo "#define CONFIG_ENABLE_DT 1" >> config.h
fi
+if config/run isbigendian; then
+ echo "#define CONFIG_BIG_ENDIAN 1" >> config.h
+else
+ echo "#define CONFIG_BIG_ENDIAN 0" >> config.h
+fi

0 comments on commit 4dfac3d

Please sign in to comment.