2 #include "parser_bits.h"
17 #define MEMCPY(p1,p2,type,n) nonempty_memcpy((p1), (p2), (sizeof(type) * (n)))
18 /* The multiplication should not overflow since this macro is used
19 * only with the already allocated size. */
21 nonempty_memcpy(void *dest
, const void *src
, size_t n
)
24 return memcpy(dest
, src
, n
);
39 #define PREFETCH(addr, write_p) __builtin_prefetch(addr, write_p)
40 #define EXPECT(expr, val) __builtin_expect(expr, val)
41 #define ATTRIBUTE_UNUSED __attribute__((unused))
43 #define PREFETCH(addr, write_p)
44 #define EXPECT(expr, val) (expr)
45 #define ATTRIBUTE_UNUSED
49 #define st_index_t parser_st_index_t
50 #define st_hash_t parser_st_hash_t
51 #define st_data_t parser_st_data_t
52 #define st_hash_type parser_st_hash_type
53 #define st_table parser_st_table
54 #define st_table_entry parser_st_table_entry
55 #define st_update_callback_func parser_st_update_callback_func
56 #define st_foreach_check_callback_func parser_st_foreach_check_callback_func
57 #define st_foreach_callback_func parser_st_foreach_callback_func
58 #define st_retval parser_st_retval
60 #define ST_CONTINUE ST2_CONTINUE
61 #define ST_STOP ST2_STOP
62 #define ST_DELETE ST2_DELETE
63 #define ST_CHECK ST2_CHECK
64 #define ST_REPLACE ST2_REPLACE
67 #define st_numcmp rb_parser_st_numcmp
69 #define st_numhash rb_parser_st_numhash
71 #define st_free_table rb_parser_st_free_table
72 #define rb_st_hash_start rb_parser_st_hash_start
74 #define st_delete rb_parser_st_delete
76 #define st_foreach rb_parser_st_foreach
77 #undef st_init_numtable
78 #define st_init_numtable rb_parser_st_init_numtable
79 #undef st_init_table_with_size
80 #define st_init_table_with_size rb_parser_st_init_table_with_size
81 #undef st_init_existing_table_with_size
82 #define st_init_existing_table_with_size rb_parser_st_init_existing_table_with_size
84 #define st_insert rb_parser_st_insert
86 #define st_lookup rb_parser_st_lookup
89 #define st_table_size rb_parser_st_table_size
91 #define st_clear rb_parser_st_clear
92 #undef st_init_strtable
93 #define st_init_strtable rb_parser_st_init_strtable
95 #define st_init_table rb_parser_st_init_table
96 #undef st_init_strcasetable
97 #define st_init_strcasetable rb_parser_st_init_strcasetable
98 #undef st_init_strtable_with_size
99 #define st_init_strtable_with_size rb_parser_st_init_strtable_with_size
100 #undef st_init_numtable_with_size
101 #define st_init_numtable_with_size rb_parser_st_init_numtable_with_size
102 #undef st_init_strcasetable_with_size
103 #define st_init_strcasetable_with_size rb_parser_st_init_strcasetable_with_size
105 #define st_memsize rb_parser_st_memsize
107 #define st_get_key rb_parser_st_get_key
109 #define st_add_direct rb_parser_st_add_direct
110 #define rb_st_add_direct_with_hash rb_parser_st_add_direct_with_hash
112 #define st_insert2 rb_parser_st_insert2
114 #define st_replace rb_parser_st_replace
116 #define st_copy rb_parser_st_copy
117 #undef st_delete_safe
118 #define st_delete_safe rb_parser_st_delete_safe
120 #define st_shift rb_parser_st_shift
121 #undef st_cleanup_safe
122 #define st_cleanup_safe rb_parser_st_cleanup_safe
124 #define st_update rb_parser_st_update
125 #undef st_foreach_with_replace
126 #define st_foreach_with_replace rb_parser_st_foreach_with_replace
127 #undef st_foreach_check
128 #define st_foreach_check rb_parser_st_foreach_check
130 #define st_keys rb_parser_st_keys
132 #define st_keys_check rb_parser_st_keys_check
134 #define st_values rb_parser_st_values
135 #undef st_values_check
136 #define st_values_check rb_parser_st_values_check
138 #define st_hash rb_parser_st_hash
139 #undef st_hash_uint32
140 #define st_hash_uint32 rb_parser_st_hash_uint32
142 #define st_hash_uint rb_parser_st_hash_uint
144 #define st_hash_end rb_parser_st_hash_end
145 #undef st_locale_insensitive_strcasecmp
146 #define st_locale_insensitive_strcasecmp rb_parser_st_locale_insensitive_strcasecmp
147 #undef st_locale_insensitive_strncasecmp
148 #define st_locale_insensitive_strncasecmp rb_parser_st_locale_insensitive_strncasecmp
150 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
151 /* GCC warns about unknown sanitizer, which is annoying. */
153 # define NO_SANITIZE(x, y) \
154 _Pragma("GCC diagnostic push") \
155 _Pragma("GCC diagnostic ignored \"-Wattributes\"") \
156 __attribute__((__no_sanitize__(x))) y; \
157 _Pragma("GCC diagnostic pop")
161 # define NO_SANITIZE(x, y) y