diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-12-30 15:46:11 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-01-01 20:46:53 +0100 |
commit | 22ac47b275c2bcad5b5ff3c0cc3e10f3caaeb65b (patch) | |
tree | 83d43e30b5becac541514dc26809046e9f22fd06 /lib/application-service/definitions/location.h | |
parent | 8f03628ee0e4d1d1cb4e2f237e8fa695bc2cde42 (diff) | |
download | libquotient-22ac47b275c2bcad5b5ff3c0cc3e10f3caaeb65b.tar.gz libquotient-22ac47b275c2bcad5b5ff3c0cc3e10f3caaeb65b.zip |
Don't use QUOTIENT_API inside REGISTER_EVENT_TYPE
On Windows QUOTIENT_API expands to different things depending on whether
the library is built or used. This results in confusing statements (and
MSVC erroring out on them, in some cases - see below - quite
legitimately) not only when the application includes Quotient headers
but also when the application defines custom events and uses
REGISTER_EVENT_TYPE to make them creatable from /sync responses.
To avoid repeated registration when dynamic linking is involved,
EventFactory<>::addMethod() now bluntly looks up the method for this
type in the vector of already registered methods. It would surely be
quicker to use a static variable instead; but since the refreshed API
for addMethod returns a reference to the factory method it's necessary
to do this lookup anyway. Once the primary goal of this branch is
achieved across platforms I might experiment with lighter ways to
register factory methods; for now here's a minimal change to make
the code build on Windows.
Diffstat (limited to 'lib/application-service/definitions/location.h')
0 files changed, 0 insertions, 0 deletions