diff --git a/meson.build b/meson.build index c54d961f..a7e35f21 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ # TODO I'm not sure how to allow building 32-bit instead of 64-bit with meson -# TODO remove cpp from this list once https://github.com/mesonbuild/meson/issues/5181 is settled; move it to the OS checks and under cpp-multithread +# TODO remove cpp from this list once https://github.com/mesonbuild/meson/issues/5181 is settled; move it to the OS checks and under test and cpp-multithread project('libui', ['c', 'cpp'], meson_version: '>=0.48.0', default_options: [ diff --git a/test/events_errors.cpp b/test/events_errors.cpp index 35ac4e41..1044e052 100644 --- a/test/events_errors.cpp +++ b/test/events_errors.cpp @@ -106,7 +106,7 @@ static const struct checkErrorCase cases[] = { checkWithGlobalEvent([](uiEvent *e) { int handler; - handler = uiEventAddHandler(e, dummyHander, NULL, NULL); + handler = uiEventAddHandler(e, dummyHandler, NULL, NULL); uiEventFree(e); uiEventDeleteHandler(e, handler); }); @@ -213,10 +213,10 @@ static const struct checkErrorCase cases[] = { "uiEventFire() with a NULL sender on a non-global event", [](void) { checkWithNonglobalEvent([](uiEvent *e) { - uiEventFIre(e, NULL, NULL); + uiEventFire(e, NULL, NULL); }); }, - "uiEventFire(): can't use a NULL sender with a non-global event") + "uiEventFire(): can't use a NULL sender with a non-global event", }, { diff --git a/test/meson.build b/test/meson.build index e65847c1..d063dbdc 100644 --- a/test/meson.build +++ b/test/meson.build @@ -16,7 +16,7 @@ if libui_OS == 'windows' ] elif libui_OS == 'darwin' libui_test_sources += [ - 'controls_darwin.m', +# 'controls_darwin.m', ] else libui_test_sources += [ @@ -24,12 +24,17 @@ else ] endif +libui_test_cpp_extra_args = [] if libui_OS == 'windows' libui_test_sources += [ windows.compile_resources('resources_' + libui_mode + '.rc', args: libui_manifest_args, depend_files: ['test_' + libui_mode + '.manifest']), ] +elif libui_OS == 'darwin' + # since we use a deployment target of 10.8, the non-C++11-compliant libstdc++ is chosen by default; we need C++11 + # see issue #302 for more details + libui_test_cpp_extra_args += ['--stdlib=libc++'] endif libui_test_deps = [] @@ -41,6 +46,8 @@ subdir('lib') libui_tester = executable('tester', libui_test_sources, dependencies: libui_binary_deps + libui_test_deps, link_with: libui_libui, + cpp_args: libui_test_cpp_extra_args, + link_args: libui_test_cpp_extra_args, gui_app: false, install: false) test('test', libui_tester, diff --git a/test/test.h b/test/test.h index 78d0616a..9816ae7b 100644 --- a/test/test.h +++ b/test/test.h @@ -45,7 +45,7 @@ struct checkErrorCase { void (*f)(void); const char *msgWant; }; -extern void checkProgrammerErrorsFull(testingT *t, const char *file, long line, struct checkErrorCase *cases, bool inThread); +extern void checkProgrammerErrorsFull(testingT *t, const char *file, long line, const struct checkErrorCase *cases, bool inThread); #define checkProgrammerErrors(t, cases) checkProgrammerErrorsFull(t, __FILE__, __LINE__, cases, false) #define checkProgrammerErrorsInThread(t, cases) checkProgrammerErrorsFull(t, __FILE__, __LINE__, cases, true)