diff --git a/api/sixtyfps-cpp/include/sixtyfps.h b/api/sixtyfps-cpp/include/sixtyfps.h index 1d8a8517e..7fe825a75 100644 --- a/api/sixtyfps-cpp/include/sixtyfps.h +++ b/api/sixtyfps-cpp/include/sixtyfps.h @@ -204,16 +204,19 @@ inline vtable::Layout drop_in_place(ComponentRef component) return vtable::Layout { sizeof(T), alignof(T) }; } -#if defined(_WIN32) || defined(_WIN64) +#if !defined(DOXYGEN) +# if defined(_WIN32) || defined(_WIN64) // On Windows cross-dll data relocations are not supported: // https://docs.microsoft.com/en-us/cpp/c-language/rules-and-limitations-for-dllimport-dllexport?view=msvc-160 // so we have a relocation to a function that returns the address we seek. That // relocation will be resolved to the locally linked stub library, the implementation of // which will be patched. -# define SIXTYFPS_GET_ITEM_VTABLE(VTableName) sixtyfps::private_api::sixtyfps_get_##VTableName() -#else -# define SIXTYFPS_GET_ITEM_VTABLE(VTableName) (&sixtyfps::private_api::VTableName) -#endif +# define SIXTYFPS_GET_ITEM_VTABLE(VTableName) \ + sixtyfps::private_api::sixtyfps_get_##VTableName() +# else +# define SIXTYFPS_GET_ITEM_VTABLE(VTableName) (&sixtyfps::private_api::VTableName) +# endif +#endif // !defined(DOXYGEN) template struct ReturnWrapper diff --git a/api/sixtyfps-cpp/include/sixtyfps_config.h b/api/sixtyfps-cpp/include/sixtyfps_config.h index 8c9afc087..14f27a97b 100644 --- a/api/sixtyfps-cpp/include/sixtyfps_config.h +++ b/api/sixtyfps-cpp/include/sixtyfps_config.h @@ -17,14 +17,16 @@ LICENSE END */ # define SIXTYFPS_TARGET_64 #endif -#if defined(_MSC_VER) -# define SIXTYFPS_DLL_IMPORT __declspec(dllimport) -#elif defined(__GNUC__) -# if defined(_WIN32) || defined(_WIN64) +#if !defined(DOXYGEN) +# if defined(_MSC_VER) # define SIXTYFPS_DLL_IMPORT __declspec(dllimport) +# elif defined(__GNUC__) +# if defined(_WIN32) || defined(_WIN64) +# define SIXTYFPS_DLL_IMPORT __declspec(dllimport) +# else +# define SIXTYFPS_DLL_IMPORT __attribute__((visibility("default"))) +# endif # else -# define SIXTYFPS_DLL_IMPORT __attribute__((visibility("default"))) +# define SIXTYFPS_DLL_IMPORT # endif -#else -# define SIXTYFPS_DLL_IMPORT -#endif \ No newline at end of file +#endif // !defined(DOXYGEN) \ No newline at end of file diff --git a/api/sixtyfps-cpp/include/sixtyfps_interpreter.h b/api/sixtyfps-cpp/include/sixtyfps_interpreter.h index 9c01e0bbe..fc994584d 100644 --- a/api/sixtyfps-cpp/include/sixtyfps_interpreter.h +++ b/api/sixtyfps-cpp/include/sixtyfps_interpreter.h @@ -15,7 +15,10 @@ LICENSE END */ #include -#define SIXTYFPS_QT_INTEGRATION // In the future, should be defined by cmake only if this is enabled +#if !defined(DOXYGEN) +# define SIXTYFPS_QT_INTEGRATION // In the future, should be defined by cmake only if this is + // enabled +#endif #ifdef SIXTYFPS_QT_INTEGRATION class QWidget; #endif @@ -564,7 +567,7 @@ public: cbindgen_private::sixtyfps_run_event_loop(); hide(); } -#ifdef SIXTYFPS_QT_INTEGRATION +#if defined(SIXTYFPS_QT_INTEGRATION) || defined(DOXYGEN) /// Return a QWidget for this instance. /// This function is only available if the qt graphical backend was compiled in, and /// it may return nullptr if the Qt backend is not used at runtime.