fix things when WITH_JVM and WITH_ILP is defined
[libfirm] / ir / be / bemodules.h
1 /*
2  * Author:      Matthias Braun
3  * Date:                11.12.2006
4  * Copyright:   (c) Universitaet Karlsruhe
5  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  */
7 #ifndef BEMODULES_H_
8 #define BEMODULES_H_
9
10 typedef void (*be_module_constructor_func)(void);
11
12 /**
13  * Use this macro to register a module constructor. You should put this macro in
14  * a .c file of your module. Compiler magic will make sure that your constructor
15  * function gets called after the main backend structures are initialized.
16  *
17  * The module constructor is a convenient place to register commandline options,
18  * or add the module to extension lists.
19  */
20 #define BE_REGISTER_MODULE_CONSTRUCTOR(func) \
21         static void __attribute__((constructor)) _be_constructor(void) \
22         {                                                              \
23                 be_module_add_constructor(func);                           \
24         }
25
26 // TODO msvc version
27
28 /**
29  * Warning: internal function, use BE_REGISTER_MODULE_CONSTRUCTOR instead.
30  *
31  * This function registers the constructor function of a backend module
32  */
33 void be_module_add_constructor(be_module_constructor_func func);
34
35 /**
36  * Call all registered constructor functions
37  */
38 void be_module_call_constructors(void);
39
40 #endif