mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fixes for compiling mruby as C++
This commit is contained in:
committed by
Yukihiro "Matz" Matsumoto
parent
477e12c182
commit
1af9e363f2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user