Apply PIE to nghttpx
[platform/upstream/nghttp2.git] / third-party / mruby / include / mrbconf.h
1 /*
2 ** mrbconf.h - mruby core configuration
3 **
4 ** See Copyright Notice in mruby.h
5 */
6
7 #ifndef MRUBYCONF_H
8 #define MRUBYCONF_H
9
10 #include <limits.h>
11 #include <stdint.h>
12
13 /* architecture selection: */
14 /* specify -DMRB_32BIT or -DMRB_64BIT to override */
15 #if !defined(MRB_32BIT) && !defined(MRB_64BIT)
16 #if UINT64_MAX == SIZE_MAX
17 #define MRB_64BIT
18 #else
19 #define MRB_32BIT
20 #endif
21 #endif
22
23 #if defined(MRB_32BIT) && defined(MRB_64BIT)
24 #error Cannot build for 32 and 64 bit architecture at the same time
25 #endif
26
27 /* configuration options: */
28 /* add -DMRB_USE_FLOAT to use float instead of double for floating point numbers */
29 //#define MRB_USE_FLOAT
30
31 /* exclude floating point numbers */
32 //#define MRB_WITHOUT_FLOAT
33
34 /* add -DMRB_METHOD_CACHE to use method cache to improve performance */
35 //#define MRB_METHOD_CACHE
36 /* size of the method cache (need to be the power of 2) */
37 //#define MRB_METHOD_CACHE_SIZE (1<<7)
38
39 /* add -DMRB_METHOD_TABLE_INLINE to reduce the size of method table */
40 /* MRB_METHOD_TABLE_INLINE requires LSB of function pointers to be zero */
41 /* you might need to specify --falign-functions=n (where n>1) */
42 //#define MRB_METHOD_TABLE_INLINE
43
44 /* add -DMRB_INT16 to use 16bit integer for mrb_int; conflict with MRB_INT64 */
45 //#define MRB_INT16
46
47 /* add -DMRB_INT64 to use 64bit integer for mrb_int; conflict with MRB_INT16 */
48 //#define MRB_INT64
49
50 /* if no specific integer type is chosen */
51 #if !defined(MRB_INT16) && !defined(MRB_INT32) && !defined(MRB_INT64)
52 # if defined(MRB_64BIT) && !defined(MRB_NAN_BOXING)
53 /* Use 64bit integers on 64bit architecture (without MRB_NAN_BOXING) */
54 #  define MRB_INT64
55 # else
56 /* Otherwise use 32bit integers */
57 #  define MRB_INT32
58 # endif
59 #endif
60
61 /* define on big endian machines; used by MRB_NAN_BOXING, etc. */
62 #ifndef MRB_ENDIAN_BIG
63 # if (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN) || \
64      (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
65 #  define MRB_ENDIAN_BIG
66 # endif
67 #endif
68
69 /* represent mrb_value in boxed double; conflict with MRB_USE_FLOAT and MRB_WITHOUT_FLOAT */
70 //#define MRB_NAN_BOXING
71
72 /* represent mrb_value as a word (natural unit of data for the processor) */
73 //#define MRB_WORD_BOXING
74
75 /* string class to handle UTF-8 encoding */
76 //#define MRB_UTF8_STRING
77
78 /* argv max size in mrb_funcall */
79 //#define MRB_FUNCALL_ARGC_MAX 16
80
81 /* number of object per heap page */
82 //#define MRB_HEAP_PAGE_SIZE 1024
83
84 /* if _etext and _edata available, mruby can reduce memory used by symbols */
85 //#define MRB_USE_ETEXT_EDATA
86
87 /* do not use __init_array_start to determine readonly data section;
88    effective only when MRB_USE_ETEXT_EDATA is defined */
89 //#define MRB_NO_INIT_ARRAY_START
90
91 /* turn off generational GC by default */
92 //#define MRB_GC_TURN_OFF_GENERATIONAL
93
94 /* default size of khash table bucket */
95 //#define KHASH_DEFAULT_SIZE 32
96
97 /* allocated memory address alignment */
98 //#define POOL_ALIGNMENT 4
99
100 /* page size of memory pool */
101 //#define POOL_PAGE_SIZE 16000
102
103 /* initial minimum size for string buffer */
104 //#define MRB_STR_BUF_MIN_SIZE 128
105
106 /* arena size */
107 //#define MRB_GC_ARENA_SIZE 100
108
109 /* fixed size GC arena */
110 //#define MRB_GC_FIXED_ARENA
111
112 /* state atexit stack size */
113 //#define MRB_FIXED_STATE_ATEXIT_STACK_SIZE 5
114
115 /* fixed size state atexit stack */
116 //#define MRB_FIXED_STATE_ATEXIT_STACK
117
118 /* -DMRB_DISABLE_XXXX to drop following features */
119 //#define MRB_DISABLE_STDIO /* use of stdio */
120
121 /* -DMRB_ENABLE_XXXX to enable following features */
122 //#define MRB_ENABLE_DEBUG_HOOK /* hooks for debugger */
123 //#define MRB_ENABLE_ALL_SYMBOLS /* Symbols.all_symbols */
124
125 /* end of configuration */
126
127 /* define MRB_DISABLE_XXXX from DISABLE_XXX (for compatibility) */
128 #ifdef DISABLE_STDIO
129 #define MRB_DISABLE_STDIO
130 #endif
131
132 /* define MRB_ENABLE_XXXX from ENABLE_XXX (for compatibility) */
133 #ifdef ENABLE_DEBUG
134 #define MRB_ENABLE_DEBUG_HOOK
135 #endif
136
137 #ifndef MRB_DISABLE_STDIO
138 # include <stdio.h>
139 #endif
140
141 #ifndef FALSE
142 # define FALSE 0
143 #endif
144
145 #ifndef TRUE
146 # define TRUE 1
147 #endif
148
149 #endif  /* MRUBYCONF_H */