hedley
hedley copied to clipboard
HEDLEY_IMPORT with C++ classes
HEDLEY_IMPORT is specificed as extern which fails when used as so:
#ifdef PROJECT_COMPILATION
#define PROJECT_API HEDLEY_PUBLIC
#else
#define PROJECT_API HEDLEY_IMPORT
#endif
class PROJECT_API example {};
We would expect that example symbols are exported. However, when importing the result is class extern example {}; which is invalid.
A possible solution is:
#ifdef __cplusplus
#define HEDLEY_IMPORT
#else
#define HEDLEY_IMPORT extern
#endif
@nemequ do you have any thoughts on this?