Fix compile error on Mac OS X 10.6: error: implicit declaration of function 'ERROR_dictionary' is invalid in C99 https://github.com/att/ast/issues/1462 https://github.com/att/ast/pull/1465/commits/f8290d2acc133953fce4e643a44c88821797add0 --- src/lib/libdll/dlfcn.c.orig +++ src/lib/libdll/dlfcn.c @@ -34,7 +34,9 @@ // void do_not_use_this_dlfcn() { abort(); } -#define T(x) ERROR_dictionary(x) +#ifndef ERROR_dictionary +#define ERROR_dictionary(s) (s) +#endif #if !_hdr_dlfcn || !_lib_dlopen #if _hdr_dl @@ -284,11 +286,11 @@ typedef struct Dll_s { static const char *dlmessage = "no error"; -static const char e_cover[] = T("cannot access covered library"); -static const char e_handle[] = T("invalid handle"); -static const char e_space[] = T("out of space"); -static const char e_static[] = T("image statically linked"); -static const char e_undefined[] = T("undefined symbol"); +static const char e_cover[] = ERROR_dictionary("cannot access covered library"); +static const char e_handle[] = ERROR_dictionary("invalid handle"); +static const char e_space[] = ERROR_dictionary("out of space"); +static const char e_static[] = ERROR_dictionary("image statically linked"); +static const char e_undefined[] = ERROR_dictionary("undefined symbol"); static Dll_t global = {DL_MAGIC};