better-enums icon indicating copy to clipboard operation
better-enums copied to clipboard

Export from DLL

Open sparcyu opened this issue 8 years ago • 3 comments

How do I use the BETTER_ENUM macro if I need to add declspec(_dllexport) ?

sparcyu avatar Mar 27 '17 12:03 sparcyu

It looks like enum.h would have to be modified to support a definable macro, which is expanded either after the class keyword or before each of the members you would like to export. Which do you think is more appropriate?

The user would be able to do something like

#define BETTER_ENUMS_EXPORT __declspec(dllexport)
#include <enum.h>

and either put that into a header file in their own project that they then include, or supply the definition on the command line.

If you would like to make a PR, I will be happy to review it.

aantron avatar Mar 27 '17 16:03 aantron

I personally would prefer whole class / struct to be exportable. How do I ask for PR ?

On Mar 27, 2017 9:13 PM, "Anton Bachin" [email protected] wrote:

It looks like enum.h would have to be modified to support a definable macro, which is expanded either after the class keyword https://github.com/aantron/better-enums/blob/37d8f987ca939af846a2d29a8f8198f9bf3ac4b7/enum.h#L588 or before each of the members you would like to export. Which do you think is more appropriate?

The user would be able to do something like

#define BETTER_ENUMS_EXPORT __declspec(dllexport) #include <enum.h>

and either put that into a header file in their own project that they then include, or supply the definition on the command line.

If you would like to make a PR, I will be happy to review it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aantron/better-enums/issues/40#issuecomment-289513600, or mute the thread https://github.com/notifications/unsubscribe-auth/AJwzf8Awk9HTJoFZlYS_iaS6G5w4QEShks5rp-jFgaJpZM4MqMMq .

sparcyu avatar Mar 27 '17 18:03 sparcyu

Fork this repo, make your changes, push them to the fork, then click the "open pull request" button next to your branch. You may want to see this help page.

aantron avatar Mar 27 '17 18:03 aantron