Commit 4a82b939 authored by cremno's avatar cremno

add more descriptive error message and fail earlier

parent 41e69319
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
#include "mruby/debug.h" #include "mruby/debug.h"
#include "mruby/error.h" #include "mruby/error.h"
#if SIZE_MAX < UINT32_MAX
# error size_t must be at least 32 bits wide
#endif
#define FLAG_BYTEORDER_BIG 2 #define FLAG_BYTEORDER_BIG 2
#define FLAG_BYTEORDER_LIL 4 #define FLAG_BYTEORDER_LIL 4
#define FLAG_BYTEORDER_NATIVE 8 #define FLAG_BYTEORDER_NATIVE 8
...@@ -28,10 +32,6 @@ ...@@ -28,10 +32,6 @@
# define SIZE_ERROR(x) (0) # define SIZE_ERROR(x) (0)
#endif #endif
#if UINT32_MAX > SIZE_MAX
# error This code cannot be built on your environment.
#endif
static size_t static size_t
skip_padding(const uint8_t *buf) skip_padding(const uint8_t *buf)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment