dotslashlu
dotslashlu

Reputation: 3401

Unexpected C function pointer definition syntax error in struct

GCC reports this weird syntax error when I include the header file in a specific file.

Error:

In file included from ../src/libscws/rule.h:17,
                 from ../src/libscws/scws.h:16,
                 from ../src/libscws/scws.c:20:
../src/libscws/../cjson/cJSON.h:58: error: expected ‘)’ before ‘sz’
../src/libscws/../cjson/cJSON.h:59: error: expected ‘;’ before ‘void’

cJSON.h:

enter image description here

Include source:

  8 #ifndef _SCWS_RULE_20070525_H_
  9 #define _SCWS_RULE_20070525_H_
 10 
 11 
 12 #ifdef __cplusplus
 13 extern "C" {
 14 #endif
 15 
 16 /* xtree required */
 17 #include "../cjson/cJSON.h"
 18 #include "xtree.h"
 19 
 20 #define SCWS_RULE_MAX     32
 21 #define SCWS_RULE_SPECIAL   0x80000000
 22 #define SCWS_RULE_NOSTATS   0x40000000

Upvotes: 0

Views: 364

Answers (1)

JS1
JS1

Reputation: 4767

It may be that size_t is not defined. Try including stddef.h before all your other headers.

Upvotes: 2

Related Questions