From af1122396c88b5ba427a6a5551087140a3b7ba37 Mon Sep 17 00:00:00 2001 From: inspiremenow Date: Wed, 9 Oct 2024 15:44:19 +0800 Subject: [PATCH] fix: replace C++ style headers and functions with C equivalents Signed-off-by: Kaiyao Duan --- tests/test_env_detect.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_env_detect.cpp b/tests/test_env_detect.cpp index dae1ccc918e..3e7965df67b 100644 --- a/tests/test_env_detect.cpp +++ b/tests/test_env_detect.cpp @@ -1,7 +1,7 @@ #include "cpu.h" -#include -#include -#include +#include +#include +#include // Improved version of is_option_disabled function that doesn't modify the original string bool is_option_disabled(const char* options, const char* option) @@ -17,7 +17,7 @@ bool is_option_disabled(const char* options, const char* option) disabled = true; break; } - token = strtok(nullptr, ","); + token = strtok(NULL, ","); } free(options_copy); @@ -37,7 +37,7 @@ bool check_instruction_disabled(const char* options, const char* option, bool cp int main() { - const char* ncnn_isa = std::getenv("NCNN_ISA"); + const char* ncnn_isa = getenv("NCNN_ISA"); // Check if NCNN_ISA is set to disable certain options if (ncnn_isa)