diff --git a/common/init.c b/common/init.c index afc48282..2cbff6fe 100644 --- a/common/init.c +++ b/common/init.c @@ -1,4 +1,5 @@ // 19 april 2019 +#include #include #include #include "ui.h" diff --git a/common/uipriv.h b/common/uipriv.h index 85f021d8..3db2660b 100644 --- a/common/uipriv.h +++ b/common/uipriv.h @@ -1,7 +1,15 @@ // 19 april 2019 +#ifdef __cplusplus +extern "C" { +#endif + // init.c extern int uiprivInitCheckParams(void *options, uiInitError *err, const char *initErrors[]); extern int uiprivInitReturnError(uiInitError *err, const char *msg); extern int uiprivInitReturnErrorf(uiInitError *err, const char *msg, ...); extern void uiprivMarkInitialized(void); + +#ifdef __cplusplus +} +#endif diff --git a/meson.build b/meson.build index 1290a470..04003747 100644 --- a/meson.build +++ b/meson.build @@ -142,7 +142,7 @@ libui_soversion = '' libui_rpath = '' subdir('common') if libui_OS == 'windows' -# subdir('windows') + subdir('windows') install_headers('ui_windows.h') elif libui_OS == 'darwin' subdir('darwin') diff --git a/test/meson.build b/test/meson.build index 9d55e675..f541d43f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -6,17 +6,17 @@ libui_test_sources = [ 'testing.c', ] -if libui_OS == 'windows' - libui_test_manifest = 'test.manifest' - if libui_mode == 'static' - libui_test_manifest = 'test.static.manifest' - endif - libui_test_sources += [ - windows.compile_resources('resources.rc', - args: libui_manifest_args, - depend_files: [libui_test_manifest]), - ] -endif +#if libui_OS == 'windows' +# libui_test_manifest = 'test.manifest' +# if libui_mode == 'static' +# libui_test_manifest = 'test.static.manifest' +# endif +# libui_test_sources += [ +# windows.compile_resources('resources.rc', +# args: libui_manifest_args, +# depend_files: [libui_test_manifest]), +# ] +#endif # TODO once we upgrade to 0.49.0, add pie: true # TODO once we upgrade to 0.50.0, add protocol: 'exitcode' diff --git a/test/testing.h b/test/testing.h index 87ae3bf8..a600ec10 100644 --- a/test/testing.h +++ b/test/testing.h @@ -6,7 +6,7 @@ #define testingprivScaffoldName(basename) testingprivScaffold ## basename #define testingprivMkScaffold(basename, argtype, argname) \ - static inline void testingprivScaffoldName(basename)(argtype *argname) { testingprivImplName(basename)(argname); } + static void testingprivScaffoldName(basename)(argtype *argname) { testingprivImplName(basename)(argname); } // references: // - https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gconstructor.h diff --git a/windows/init.cpp b/windows/init.cpp index f2c8bb1e..c031e102 100644 --- a/windows/init.cpp +++ b/windows/init.cpp @@ -1,6 +1,5 @@ // 6 april 2015 #include "uipriv_windows.hpp" -#include "attrstr.hpp" HINSTANCE uipriv_hInstance = NULL; int uipriv_nCmdShow; @@ -61,27 +60,27 @@ int uiInit(void *options, uiInitError *err) return uiprivInitReturnHRESULT(err, errICCFailed, HRESULT_FROM_WIN32(lasterr)); } - hr = CoInitialize(NULL); +/* hr = CoInitialize(NULL); if (hr != S_OK && hr != S_FALSE) return ieHRESULT("initializing COM", hr); // LONGTERM initialize COM security // LONGTERM turn off COM exception handling - +*/ uiprivMarkInitialized(); return 1; } void uiUninit(void) { - CoUninitialize(); +// CoUninitialize(); } #ifndef uiStatic -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) - hInstance = hinstDLL; + uipriv_hInstance = hInstance; return TRUE; } diff --git a/windows/meson.build b/windows/meson.build index 952dad7b..e534bc39 100644 --- a/windows/meson.build +++ b/windows/meson.build @@ -10,13 +10,13 @@ libui_sources += [ # For a DLL, we have to include this directly, so we do so. # Windows won't link resources in static libraries, so including this would have no effect. # In those cases, we just need them to include the manifest with the executable (or link it directly into the output executable themselves); they can also customize the manifest as they see fit (assuming nothing breaks in the process). -if libui_mode == 'shared' - libui_sources += [ - windows.compile_resources('resources.rc', - args: libui_manifest_args, - depend_files: ['libui.manifest']), - ] -endif +#if libui_mode == 'shared' +# libui_sources += [ +# windows.compile_resources('resources.rc', +# args: libui_manifest_args, +# depend_files: ['libui.manifest']), +# ] +#endif foreach lib : ['user32', 'kernel32', 'gdi32', 'comctl32'] libui_deps += [