pike.git / src / errors.h

version» Context lines:

pike.git/src/errors.h:4:   #define DECLARE_ERROR(NAME, INHERIT, DECL) \   struct program *PIKE_CONCAT(NAME,_error_program); \   int PIKE_CONCAT(NAME,_error_offset);      #define ERR_VAR(TYPE,CTYPE,RUNTYPE,NAME) TYPE NAME ;   #endif      #ifdef ERR_EXT_DECLARE   #define DECLARE_ERROR(NAME, INHERIT, DECL) \   extern struct program *PIKE_CONCAT(NAME,_error_program); \ - extern int PIKE_CONCAT(NAME,_error_offset); \ + extern ptrdiff_t PIKE_CONCAT(NAME,_error_offset); \   struct PIKE_CONCAT(NAME,_error_struct) { \    DECL \   };      #define ERR_VAR(TYPE,CTYPE,RUNTYPE,NAME) TYPE NAME ;   #endif /* ERR_EXT_DECLARE */      #ifdef ERR_SETUP   #define DECLARE_ERROR(NAME, INHERIT, DECL) do{ \ -  int current_offset=0; \ +  ptrdiff_t current_offset=0; \    struct PIKE_CONCAT(NAME,_error_struct) foo; \    start_new_program(); \    INHERIT \ -  current_offset = PIKE_CONCAT(NAME,_error_offset)=ADD_STORAGE(struct PIKE_CONCAT(NAME,_error_struct));\ +  current_offset = PIKE_CONCAT(NAME,_error_offset) = \ +  ADD_STORAGE(struct PIKE_CONCAT(NAME,_error_struct));\    add_string_constant("error_type",#NAME "_error",0); \    add_integer_constant("is_" #NAME "_error",1,0); \    DECL \    PIKE_CONCAT(NAME,_error_program)=end_program(); \    add_program_constant( #NAME "_error",PIKE_CONCAT(NAME,_error_program),0); \   }while(0);      #define ERR_VAR(TYPE,CTYPE,RUNTYPE,NAME2) \    map_variable("__" #NAME2, #CTYPE, 0, \    current_offset + (((char *)&(foo.NAME2))-((char *)&foo)), RUNTYPE);