Fixes for compiling mruby as C++

This commit is contained in:
Tomasz Dąbrowski
2016-11-22 13:19:05 +01:00
committed by Yukihiro "Matz" Matsumoto
parent 477e12c182
commit 1af9e363f2
7 changed files with 30 additions and 14 deletions
+16
View File
@@ -28,10 +28,26 @@
#ifndef MRUBY_H
#define MRUBY_H
#ifdef __cplusplus
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <stdint.h>
#include <stddef.h>
#include <limits.h>
#ifdef __cplusplus
#ifndef SIZE_MAX
#ifdef __SIZE_MAX__
#define SIZE_MAX __SIZE_MAX__
#else
#define SIZE_MAX std::numeric_limits<size_t>::max()
#endif
#endif
#endif
#ifdef MRB_DEBUG
#include <assert.h>
#define mrb_assert(p) assert(p)