Compiling via C code #208
-
Hello, I've noticed that most headers are C compatible, but when I tried to compile, I encountered some issues like:
Is it possible to compile it via pure c, or are there features, which would not allow to do it ? The reason I'm asking is because I'm trying to create bindings to Crystal language. I'll try and see if I can apply fixes manually, but it would be good to know if it's not possible. Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
In CGO it is patched as https://github.com/sciter-sdk/go-sciter/blob/master/sciter-x-api.c#L10-L26 |
Beta Was this translation helpful? Give feedback.
-
Will this be better? inline ISciterAPI* SAPI() {
#if defined(__cplusplus) && !defined(PLAIN_API_ONLY)
static ISciterAPI* _api = _SAPI(NULL);
#else
static ISciterAPI* _api = 0;
if (!_api) _api = _SAPI(NULL);
#endif
return _api;
} |
Beta Was this translation helpful? Give feedback.
-
Did you compile this as WINDOWLESS? sciter-sdk/include/sciter-x-api.h Lines 562 to 565 in 29a598b |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help. I managed to build it properly, by first building a C file, where I re-defined all functions, then use that library file as the main entry. You can see it here https://github.com/WhoAteDaCake/sciter-tests |
Beta Was this translation helpful? Give feedback.
Thanks for the help. I managed to build it properly, by first building a C file, where I re-defined all functions, then use that library file as the main entry. You can see it here https://github.com/WhoAteDaCake/sciter-tests