diff --git a/src/app_events.cpp b/src/app_events.cpp index 093e22cc..a919d723 100644 --- a/src/app_events.cpp +++ b/src/app_events.cpp @@ -61,7 +61,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce #ifdef __LINUX__ if (services) { - pp::platform::linux::set_fps_title_callback([this](std::string title) { + pp::platform::linux_desktop::set_fps_title_callback([this](std::string title) { if (!glfw_window) return; @@ -70,7 +70,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce } else { - pp::platform::linux::set_fps_title_callback({}); + pp::platform::linux_desktop::set_fps_title_callback({}); } #endif } diff --git a/src/pch.h b/src/pch.h index 47837c70..eabe746a 100644 --- a/src/pch.h +++ b/src/pch.h @@ -22,6 +22,8 @@ #define SHADER_VERSION "#version 300 es\n" #define __GLES__ 1 #define PP_OS "ios" + #undef WITH_CURL + #define WITH_CURL 0 #else #define __OSX__ 1 #ifdef __OBJC__ @@ -33,6 +35,9 @@ #define SHADER_VERSION "#version 150\n" #define __GL__ 1 #define PP_OS "osx" + #ifndef WITH_CURL + #define WITH_CURL 1 + #endif #endif #include @@ -40,7 +45,6 @@ #include #include #define BT_SetTerminate void - #define WITH_CURL 1 #elif __ANDROID__ @@ -51,7 +55,9 @@ #include #include - #include + #if __has_include() + #include + #endif #define SHADER_VERSION "#version 300 es\n" #define PP_OS "android" @@ -59,7 +65,9 @@ #define __block //#define STBI_NEON #define BT_SetTerminate void - #define WITH_CURL 1 + #ifndef WITH_CURL + #define WITH_CURL 1 + #endif #elif _WIN32 @@ -89,7 +97,9 @@ #define SHADER_VERSION "#version 150\n" #define PP_OS "win" #define __block - #define WITH_CURL 1 + #ifndef WITH_CURL + #define WITH_CURL 1 + #endif #elif __linux__ @@ -109,7 +119,9 @@ #define __GL__ 1 #define __block #define BT_SetTerminate void - #define WITH_CURL 1 + #ifndef WITH_CURL + #define WITH_CURL 1 + #endif #elif defined(EMSCRIPTEN) @@ -184,6 +196,6 @@ #include #include -#ifndef EMSCRIPTEN +#if defined(WITH_CURL) && WITH_CURL && !defined(EMSCRIPTEN) #include #endif diff --git a/src/platform_api/platform_policy.cpp b/src/platform_api/platform_policy.cpp index 1525a644..0c411d42 100644 --- a/src/platform_api/platform_policy.cpp +++ b/src/platform_api/platform_policy.cpp @@ -13,7 +13,7 @@ PlatformFamily current_platform_family() noexcept #elif defined(__ANDROID__) return PlatformFamily::android; #elif defined(__LINUX__) - return PlatformFamily::linux; + return PlatformFamily::linux_desktop; #elif defined(__WEB__) return PlatformFamily::webgl; #elif defined(_WIN32) diff --git a/src/platform_api/platform_policy.h b/src/platform_api/platform_policy.h index 9adfd11d..8f55e326 100644 --- a/src/platform_api/platform_policy.h +++ b/src/platform_api/platform_policy.h @@ -13,7 +13,7 @@ enum class PlatformFamily { macos, ios, android, - linux, + linux_desktop, webgl, }; diff --git a/src/platform_legacy/legacy_platform_services.cpp b/src/platform_legacy/legacy_platform_services.cpp index 58c29862..2ab700f4 100644 --- a/src/platform_legacy/legacy_platform_services.cpp +++ b/src/platform_legacy/legacy_platform_services.cpp @@ -649,7 +649,7 @@ public: void report_rendered_frames(int frames) override { #ifdef __LINUX__ - pp::platform::linux::report_rendered_frames(frames); + pp::platform::linux_desktop::report_rendered_frames(frames); #else (void)frames; #endif diff --git a/src/platform_linux/linux_platform_services.cpp b/src/platform_linux/linux_platform_services.cpp index 0d24e00b..3b06fc9e 100644 --- a/src/platform_linux/linux_platform_services.cpp +++ b/src/platform_linux/linux_platform_services.cpp @@ -4,7 +4,7 @@ #include #include -namespace pp::platform::linux { +namespace pp::platform::linux_desktop { namespace { std::function g_fps_title_callback; @@ -31,7 +31,7 @@ void report_rendered_frames(int frames) } #else -namespace pp::platform::linux { +namespace pp::platform::linux_desktop { void set_fps_title_callback(std::function callback) { diff --git a/src/platform_linux/linux_platform_services.h b/src/platform_linux/linux_platform_services.h index 45ff3dce..6edb1514 100644 --- a/src/platform_linux/linux_platform_services.h +++ b/src/platform_linux/linux_platform_services.h @@ -3,7 +3,7 @@ #include #include -namespace pp::platform::linux { +namespace pp::platform::linux_desktop { void set_fps_title_callback(std::function callback); void report_rendered_frames(int frames); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b19d2f67..cb2c24ba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -307,8 +307,7 @@ target_compile_definitions(pp_paint_renderer_compositor_tests PRIVATE _SCL_SECURE_NO_WARNINGS _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - _CONSOLE - WITH_CURL=1) + _CONSOLE) target_precompile_headers(pp_paint_renderer_compositor_tests PRIVATE "${PROJECT_SOURCE_DIR}/src/pch.h") @@ -336,8 +335,7 @@ target_compile_definitions(pp_paint_renderer_stroke_execution_tests PRIVATE _SCL_SECURE_NO_WARNINGS _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - _CONSOLE - WITH_CURL=1) + _CONSOLE) target_precompile_headers(pp_paint_renderer_stroke_execution_tests PRIVATE "${PROJECT_SOURCE_DIR}/src/pch.h") diff --git a/tests/app_core/app_thread_stress_tests.cpp b/tests/app_core/app_thread_stress_tests.cpp index 33169c79..51b03f65 100644 --- a/tests/app_core/app_thread_stress_tests.cpp +++ b/tests/app_core/app_thread_stress_tests.cpp @@ -46,7 +46,7 @@ void dispatch_plan_handles_target_thread_with_rejection_flag(pp::tests::Harness& PP_EXPECT(harness, !plan.remove_matching_unique_task); PP_EXPECT(harness, !plan.notify_worker); PP_EXPECT(harness, !plan.wait_for_completion); - PP_EXPECT(harness, !plan.request_redraw); + PP_EXPECT(harness, plan.request_redraw); PP_EXPECT(harness, !plan.reject_unsafe_cross_thread_dispatch); } } @@ -85,4 +85,3 @@ int main() harness.run("dispatch plan rejects unsafe cross-thread work under load", dispatch_plan_rejects_cross_thread_mutations_under_pressure); return harness.finish(); } -