- eliminate duplicat symbols across modules
- modified: test9/module* test11/module* test12/module*
This commit is contained in:
parent
21695a8b18
commit
b55ebd6130
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule1_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
class CellPhone : public DeviceInterface {
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule2_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
class GPS_Receiver : public DeviceInterface {
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef _buildsym
|
||||
// This section 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)
|
||||
extern "C" {
|
||||
// this prevents C++ name mangling
|
||||
// the extern "C" prevents C++ name mangling
|
||||
class DeviceInterface * module_init ();
|
||||
int operate (int a, int b);
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef class DeviceInterface* (*modload_func)(void);
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule1_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
class CellPhone : public DeviceInterface {
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule2_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
class GPS_Receiver : public DeviceInterface {
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef _buildsym
|
||||
// This section 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)
|
||||
extern "C" {
|
||||
// this prevents C++ name mangling
|
||||
// the extern "C" prevents C++ name mangling
|
||||
class DeviceInterface * module_init ();
|
||||
int operate (int a, int b);
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef class DeviceInterface* (*modload_func)(void);
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule1_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
class ModuleGadget* module_init ()
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#define _buildsym(sym) libmodule2_LTX_##sym
|
||||
#include "modules.h"
|
||||
|
||||
int n_operations = 0;
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef _buildsym
|
||||
// This section 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)
|
||||
extern "C" {
|
||||
// this prevents C++ name mangling
|
||||
// the extern "C" prevents C++ name mangling
|
||||
class ModuleGadget * module_init ();
|
||||
int operate (int a, int b);
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef class ModuleGadget* (*modload_func)(void);
|
||||
|
||||
@ -14,3 +24,4 @@ public:
|
||||
virtual const char* getName ();
|
||||
virtual const char* getFeatures ();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user