X-Git-Url: http://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/b1b2de814d2c59af2526bc19d41bb22a0c1fd16d..aba5c4579802a0df4fc1e60559a8ff389cc0cc42:/standard.h diff --git a/standard.h b/standard.h index ff30864..309bfeb 100644 --- a/standard.h +++ b/standard.h @@ -1,19 +1,29 @@ -// clone: yacfe(master), coccinelle, acomment, - // **************************************************************************** -// Prelude, this file is to be used with the -macro_file option of the C parser +// Prelude, this file is used with -macro_file_builtins option of the C parser // **************************************************************************** /* This file contains: * - macros found in <.h> + * - macros found in ".h" + * but where we cant detect that it will be a "bad macro" + * - hints, cf below. + * + * A "bad macro" is a macro using free variables or when expanded + * that influence the control-flow of the code. In those cases it + * is preferable to expand the macro so that the coccinelle engine + * has a more accurate representation of what is going on. + * + * + * + * + * old: this file was also containing what is below but now we + * try to expand on demand the macro found in the c file, so those cases + * are not needed any more: * - macros found in .c; macros that cannot be parsed. * In the future should be autodetected * (not so easy to do same for macros in .h cos require to access .h file) - * - macros found in ".h" - * but where we cant detect that it will be a "bad macro" * - macros found in .c; macros correctly parsed * but where we cant detect that it will be a "bad macro" - * - hints, cf below. * * Some of those macros could be deleted and the C code rewritten because * they are "bad" macros. @@ -54,28 +64,20 @@ // #define FOO(a,b) fn(a,b) #define FOO_METH_TEST(a) YACFE_IDENT_BUILDER -// **************************************************************************** -// Generic macros -// **************************************************************************** +//#define FOO YACFE_DECLARATOR // **************************************************************************** -// Yacc macros -// **************************************************************************** - -#define YY_PROTO(x) x -#define yyconst const - - -// **************************************************************************** -// GNU Hello macros +// Generic macros // **************************************************************************** -#define __getopt_argv_const const - +// this is defined by windows compiler, and so can not be found via a macro +// after a -extract_macros +// update: now handled in lexer, simplify stuff +//#define __stdcall /*could: YACFE_ATTRIBUTE*/ +//#define __declspec(a) -// **************************************************************************** -// Gcc (as in the source of gcc code) macros -// **************************************************************************** +//#define WINAPI +//#define CALLBACK // **************************************************************************** @@ -171,8 +173,8 @@ // maybe only in old kernel #define __openfirmware - -#define __extension__ +// now in lexer +//#define __extension__ #define __thread #define __used @@ -183,6 +185,14 @@ #define __uses_jump_to_uncached + +// last last +#define __net_init +#define __net_exit +#define __net_initdata + +#define __paginginit // in mm + // ---------------------------------------------------------------------------- // String macros // ---------------------------------------------------------------------------- @@ -270,6 +280,10 @@ #define TRACE_EXIT return +#define notrace + +#define noinline_for_stack // in fs +#define debug_noinline // in net // ---------------------------------------------------------------------------- // linkage @@ -344,7 +358,10 @@ #define __releases(x) #define __acquires(x) -#define __declspec(x) + +//now in lexer +//#define __declspec(x) + #define __page_aligned(x) #define __vsyscall(x) @@ -732,73 +749,3 @@ do { \ // rule10 //#define ACPI_MODULE_NAME(x) - - - - -// **************************************************************************** -// Httpd (apache) macros -// **************************************************************************** - -#define AP_DECLARE(x) x -#define PROXY_DECLARE(x) x -#define CACHE_DECLARE(x) x -#define DBD_DECLARE_NONSTD(x) x -#define DAV_DECLARE(x) x -#define APU_DECLARE(x) x -#define APU_DECLARE_NONSTD(x) x -#define APR_DECLARE(x) x -#define AP_CORE_DECLARE(x) x -#define AP_DECLARE_NONSTD(x) x -#define AP_CORE_DECLARE_NONSTD(x) x -#define APR_OPTIONAL_FN_TYPE(x) x -#define DAV_DECLARE_NONSTD(x) x -#define APR_DECLARE_NONSTD(x) x - -#define APU_DECLARE_DATA -#define APR_THREAD_FUNC -#define AP_DECLARE_DATA -#define PROXY_DECLARE_DATA -#define AP_MODULE_DECLARE_DATA -#define APR_DECLARE_DATA - - - -#define APR_INLINE inline -#define EXPORT static -#define REGISTER register - -#define MODSSL_D2I_SSL_SESSION_CONST const -#define MODSSL_D2I_X509_CONST const -#define MODSSL_D2I_PrivateKey_CONST const -#define MODSSL_D2I_SSL_SESSION_CONST const - -#define STACK_OF(X509_NAME) X509_NAME - -#define MODSSL_PCHAR_CAST (pchar) - -#define WINAPI -//#define CALLBACK -// generate false positive in Linux -#define APIENTRY -#define __declspec(x) -#define __stdcall - - -//#define module struct xxx - -#define APR_POOL_IMPLEMENT_ACCESSOR(shm) - -#define ADD_SUITE(suite) suite; - -// **************************************************************************** -// CISCO vpn client macros -// **************************************************************************** - -// #define NOREGPARM -// #define IN -// #define OUT -// #define OPTIONAL - -#define likely(x) x -#define unlikely(x) x