diff options
Diffstat (limited to 'compat')
| -rw-r--r-- | compat/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | compat/lang/de_DE.ts | 4 | ||||
| -rw-r--r-- | compat/process-list.hpp | 23 |
3 files changed, 22 insertions, 9 deletions
diff --git a/compat/CMakeLists.txt b/compat/CMakeLists.txt index fb498fb6..dc81436d 100644 --- a/compat/CMakeLists.txt +++ b/compat/CMakeLists.txt @@ -1,7 +1,3 @@ -if(CMAKE_COMPILER_IS_GNUCXX) - add_compile_options(-fno-lto -fno-fast-math -fno-finite-math-only -O0) -endif() - otr_module(compat NO-COMPAT BIN) if(NOT WIN32 AND NOT APPLE) diff --git a/compat/lang/de_DE.ts b/compat/lang/de_DE.ts new file mode 100644 index 00000000..1552582e --- /dev/null +++ b/compat/lang/de_DE.ts @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de_DE"> +</TS> diff --git a/compat/process-list.hpp b/compat/process-list.hpp index 6d960610..39e12603 100644 --- a/compat/process-list.hpp +++ b/compat/process-list.hpp @@ -52,7 +52,7 @@ static QStringList get_all_executable_names() template<typename = void> static QStringList get_all_executable_names() { - QStringList ret; + QStringList ret; ret.reserve(2048); std::vector<int> vec; while (true) @@ -138,19 +138,32 @@ static QStringList get_all_executable_names() template<typename = void> QStringList get_all_executable_names() { - QStringList ret; + QStringList ret; ret.reserve(2048); enum pids_item items[] = { PIDS_ID_PID, PIDS_CMD, PIDS_CMDLINE_V }; enum rel_items { rel_pid, rel_cmd, rel_cmdline }; struct pids_info *info = NULL; struct pids_stack *stack; - QString tmp; tmp.reserve(64); + QString tmp; tmp.reserve(255); procps_pids_new(&info, items, 3); + // procps-ng version 4.0.5 removed an unused argument in PIDS_VAL() macro. + // cf. https://gitlab.com/procps-ng/procps/-/commit/967fdcfb06e20aad0f3 + + // Although the emitted machine code is identical, backward API + // compatibility was silently broken in the patch with no upgrade path + // (e.g. deprecating PIDS_VAL() while introducing PIDS_VAL2()). + + // Unfortunately, procps-ng doesn't include a #define for identifying its + // version. For these reasons the code below depends on undocumented ABI + // compatibility between procps-ng versions.. -sh 20241226 + +#define OPENTRACK_PIDS_VAL(i, type, stack) stack->head[i].result.type + while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) { - char **p_cmdline = PIDS_VAL(rel_cmdline, strv, stack, info); + char **p_cmdline = OPENTRACK_PIDS_VAL(rel_cmdline, strv, stack); // note, wine sets argv[0] so no parsing like in OSX case if (p_cmdline && p_cmdline[0] && p_cmdline[0][0] && @@ -177,7 +190,7 @@ QStringList get_all_executable_names() template<typename = void> QStringList get_all_executable_names() { - QStringList ret; + QStringList ret; ret.reserve(2048); proc_t** procs = readproctab(PROC_FILLCOM); if (procs == nullptr) { |
