R
Richard
1. Are there any problems with having, for instance, POSIX's "open"
function #defined more than once. In my case, these would be in
different static libraries:
#ifdef __cplusplus
extern "C" {
#endif
#define open myOpenFunction1
#ifdef __cplusplus
}
#endif
-and-
#ifdef __cplusplus
extern "C" {
#endif
#define open myOpenFunction2
#ifdef __cplusplus
}
#endif
2. Different way of doing the same thing... Are there any problems
with having the same code to #define open as myOpenFunction1 (only
#define once this time), but have two implementations (definitions) of
myOpenFunction1? I've seen linking issues due to multiply defined
symbols before, but this seems to pass with the linker. Both
definitions are in 'extern "C"' - is that why the compiler isn't
complaining, or is it simply because one of them isn't linked for one
reason or another?
function #defined more than once. In my case, these would be in
different static libraries:
#ifdef __cplusplus
extern "C" {
#endif
#define open myOpenFunction1
#ifdef __cplusplus
}
#endif
-and-
#ifdef __cplusplus
extern "C" {
#endif
#define open myOpenFunction2
#ifdef __cplusplus
}
#endif
2. Different way of doing the same thing... Are there any problems
with having the same code to #define open as myOpenFunction1 (only
#define once this time), but have two implementations (definitions) of
myOpenFunction1? I've seen linking issues due to multiply defined
symbols before, but this seems to pass with the linker. Both
definitions are in 'extern "C"' - is that why the compiler isn't
complaining, or is it simply because one of them isn't linked for one
reason or another?