Refactor cffi build script to extract defines from header file

This adds functionality to the cffi build script to also extract
defines so that we can ask the compiler to figure out what the correct
values are.  To do this we need to be able to locate the header file
used in the first place, for which we add a small utility in the
header file itself guarded to only be compiled for this specific case.
This commit is contained in:
Floris Bruynooghe
2020-06-08 23:08:54 +02:00
committed by holger krekel
parent 69e01862b7
commit 27b75103ca
2 changed files with 181 additions and 55 deletions

View File

@@ -4434,6 +4434,13 @@ void dc_event_unref(dc_event_t* event);
* @}
*/
#ifdef PY_CFFI_INC
/* Helper utility to locate the header file when building python bindings. */
char* _dc_header_file_location(void) {
return __FILE__;
}
#endif
#ifdef __cplusplus
}