Fix build on big endian systems by defining MRB_ENDIAN_BIG

Tested on sparc64 by jca@
OK jca@
This commit is contained in:
jeremy 2018-12-20 18:41:45 +00:00
parent 3dd8bab3a8
commit 51d0010521
2 changed files with 26 additions and 1 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.10 2018/12/17 20:28:27 jeremy Exp $
# $OpenBSD: Makefile,v 1.11 2018/12/20 18:41:45 jeremy Exp $
COMMENT = lightweight, embeddable implementation of ruby
VERSION = 2.0.0
DISTNAME = mruby-${VERSION}
REVISION = 0
CATEGORIES = lang
HOMEPAGE = https://github.com/mruby/mruby

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-include_mrbconf_h,v 1.1 2018/12/20 18:41:45 jeremy Exp $
Index: include/mrbconf.h
--- include/mrbconf.h.orig
+++ include/mrbconf.h
@@ -7,6 +7,7 @@
#ifndef MRUBYCONF_H
#define MRUBYCONF_H
+#include <endian.h>
#include <limits.h>
#include <stdint.h>
@@ -62,7 +63,9 @@
//#define MRB_NAN_BOXING
/* define on big endian machines; used by MRB_NAN_BOXING */
-//#define MRB_ENDIAN_BIG
+#if (BYTE_ORDER == BIG_ENDIAN)
+#define MRB_ENDIAN_BIG
+#endif
/* represent mrb_value as a word (natural unit of data for the processor) */
//#define MRB_WORD_BOXING