@@ -14,7 +14,7 @@ typedef struct FBufferStruct {
1414 unsigned long initial_length ;
1515 unsigned long len ;
1616 unsigned long capa ;
17- #ifdef JSON_DEBUG
17+ #if JSON_DEBUG
1818 unsigned long requested ;
1919#endif
2020 char * ptr ;
@@ -45,14 +45,14 @@ static void fbuffer_stack_init(FBuffer *fb, unsigned long initial_length, char *
4545 fb -> ptr = stack_buffer ;
4646 fb -> capa = stack_buffer_size ;
4747 }
48- #ifdef JSON_DEBUG
48+ #if JSON_DEBUG
4949 fb -> requested = 0 ;
5050#endif
5151}
5252
5353static inline void fbuffer_consumed (FBuffer * fb , unsigned long consumed )
5454{
55- #ifdef JSON_DEBUG
55+ #if JSON_DEBUG
5656 if (consumed > fb -> requested ) {
5757 rb_bug ("fbuffer: Out of bound write" );
5858 }
@@ -122,7 +122,7 @@ static void fbuffer_do_inc_capa(FBuffer *fb, unsigned long requested)
122122
123123static inline void fbuffer_inc_capa (FBuffer * fb , unsigned long requested )
124124{
125- #ifdef JSON_DEBUG
125+ #if JSON_DEBUG
126126 fb -> requested = requested ;
127127#endif
128128
@@ -148,7 +148,7 @@ static inline void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long
148148/* Appends a character into a buffer. The buffer needs to have sufficient capacity, via fbuffer_inc_capa(...). */
149149static inline void fbuffer_append_reserved_char (FBuffer * fb , char chr )
150150{
151- #ifdef JSON_DEBUG
151+ #if JSON_DEBUG
152152 if (fb -> requested < 1 ) {
153153 rb_bug ("fbuffer: unreserved write" );
154154 }
@@ -174,7 +174,7 @@ static void fbuffer_append_str_repeat(FBuffer *fb, VALUE str, size_t repeat)
174174
175175 fbuffer_inc_capa (fb , repeat * len );
176176 while (repeat ) {
177- #ifdef JSON_DEBUG
177+ #if JSON_DEBUG
178178 fb -> requested = len ;
179179#endif
180180 fbuffer_append_reserved (fb , newstr , len );
0 commit comments