From 8553a8d63f97cfa8d64b5b2260e81f8c896a8398 Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: 周五, 23 5月 2025 18:36:03 +0800 Subject: [PATCH] 修改部分因为标准原因的报错 --- src/library/ini/SimpleIni.h | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/library/ini/SimpleIni.h b/src/library/ini/SimpleIni.h index 05e2631..ed43eba 100644 --- a/src/library/ini/SimpleIni.h +++ b/src/library/ini/SimpleIni.h @@ -218,12 +218,13 @@ #include <list> #include <algorithm> #include <stdio.h> +#include <functional> #ifdef SI_SUPPORT_IOSTREAMS # include <iostream> #endif // SI_SUPPORT_IOSTREAMS -#ifdef _DEBUG +#ifndef NDEBUG # ifndef assert # include <cassert> # endif @@ -244,7 +245,7 @@ }; #define SI_UTF8_SIGNATURE "\xEF\xBB\xBF" - +#include <functional> #ifdef _WIN32 # define SI_NEWLINE_A "\r\n" # define SI_NEWLINE_W L"\r\n" @@ -325,8 +326,9 @@ bool operator>(const Entry & rhs) const { return LoadOrder()(rhs, *this); } #endif - /** Strict less ordering by name of key only */ - struct KeyOrder : std::binary_function<Entry, Entry, bool> { + /** Strict less ordering by name of key only */ + + struct KeyOrder /*: std::binary_function<Entry, Entry, bool>*/{ bool operator()(const Entry & lhs, const Entry & rhs) const { const static SI_STRLESS isLess = SI_STRLESS(); return isLess(lhs.pItem, rhs.pItem); @@ -334,7 +336,9 @@ }; /** Strict less ordering by order, and then name of key */ - struct LoadOrder : std::binary_function<Entry, Entry, bool> { + struct LoadOrder /*: std::binary_function<Entry, Entry, bool>*/ + { + bool operator()(const Entry & lhs, const Entry & rhs) const { if (lhs.nOrder != rhs.nOrder) { return lhs.nOrder < rhs.nOrder; @@ -1912,7 +1916,7 @@ if (pComment) { DeleteString(a_pComment); a_pComment = pComment; - CopyString(a_pComment); + (void)CopyString(a_pComment); } Delete(a_pSection, a_pKey); iKey = keyval.end(); @@ -2489,6 +2493,9 @@ bNeedNewLine = true; } + // Append new empty line + a_oOutput.Write(SI_NEWLINE_A); + return SI_OK; } -- Gitblit v1.9.1