1 /* copyright 2016 Apache 2 sddekit authors */
13 /* standard C includes {{{ */
22 /* -DSD_API_EXPORT dllexport {{{ */
24 #define SD_API __declspec(dllexport)
27 #define SD_API __declspec(dllimport)
34 /* ignore restrict if compiler doesn't support it {{{ */
35 #if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
36 # define restrict __restrict
37 #elif defined(_MSC_VER) && _MSC_VER >= 1400
38 # define restrict __restrict
44 /* cf. https://gist.github.com/maedoc/f22f691c1ee22fe1961d#prelude {{{ */
45 #define SD_AS(obj, type) (((obj)->type)(obj))
47 #define SD_CALL_AS(obj, type, meth, ...) \
48 SD_AS(obj, type)->meth(SD_AS(obj, type), __VA_ARGS__)
50 #define SD_CALL_AS_(obj, type, meth) \
51 SD_AS(obj, type)->meth(SD_AS(obj, type))
55 /* contains actual C declarations of API */
56 #include "sddekit_api.h"
64 /* vim: foldmethod=marker