Re: [AD] Addon public API function declarations |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Elias Pschernig wrote:
Well, look for example at a5_font.h. What is the reason to have the
author of the addon #define their own _ALLEGRO_FONT_DLL instead of just
using a macro like _ALLEGRO_ADDON_DLL which can be shared by all addons?
The entire first half of that header could then be removed, making it a
lot more readable.
a5_font uses a5_iio.
a5_font.h has ALLEGRO_FONT_FUNC(void, al_font_init, (void));
a5_iio.h has A5_IIO_FUNC(bool, al_iio_init, (void));
font.c includes both
When compiling font.c, ALLEGRO_FONT_FUNC needs to expand to
__declspec(dllexport), A5_IIO_FUNC needs to expand to __declspec(dllimport).
Using different macros or each addon is the easiest way to achieve this.
--
Milan Mimica
http://sparklet.sf.net