Bochs/bochs-testing/plugin-test/test6-ltdlopen/modules.h
Bryce Denney 0710552145 - rename module symbols to make them unique. For example, now module_init
is libmodule1_LTX_module_init in module1.  This is all done in the
  modules.h header file so the .cc files still looks clean.
- modified: module1.cc module2.cc
- added: modules.h
2002-10-17 05:36:18 +00:00

18 lines
671 B
C

// This file is included by each module to rename all of its symbols, in order
// to avoid duplicate symbols in different modules. From the libtool docs:
// "Although some platforms support having the same symbols defined more than
// once it is generally not portable."
#define module_init _buildsym(module_init)
#define operate _buildsym(operate)
// Declare function prototypes in an extern "C" block so that C++ will not
// mangle their names (any more than we already have).
extern "C" {
void module_init();
int operate (int a, int b);
};
// Since the renaming and extern "C" stuff declaration is done in the
// header file, the actual code remains readable.