summaryrefslogtreecommitdiff
path: root/src/table/win32_settings.ini
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-14 00:14:37 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-13 20:08:53 +0100
commit7845434270524d4c777a6711d2e17ac89eeeeb89 (patch)
tree161cb867662f70f6f242699b811929936c290938 /src/table/win32_settings.ini
parent9c9292949fa4d699c58d40abcac563a86df239dd (diff)
downloadopenttd-7845434270524d4c777a6711d2e17ac89eeeeb89.tar.xz
Codechange: Don't use cpp_offsetof in the save/load code.
Many of the member variables that are used in save/load are inside types that are not standard layout types. Using pointer arithmetics to determine addresses of members inside types that are not standard layout is generally undefined behaviour. If we'd use C++17, it is conditionally supported, which means each compiler may or may not support it. And even then using it for individual array elements is syntactically not supported the the standard offsetof function. Unfortunately, the trickery employed for saving linkgraph settings causes quite some clutter in the settings ini files.
Diffstat (limited to 'src/table/win32_settings.ini')
-rw-r--r--src/table/win32_settings.ini5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/table/win32_settings.ini b/src/table/win32_settings.ini
index c7915e32b..d1cc72dd7 100644
--- a/src/table/win32_settings.ini
+++ b/src/table/win32_settings.ini
@@ -15,8 +15,8 @@ static const SettingDescGlobVarList _win32_settings[] = {
};
#endif /* _WIN32 */
[templates]
-SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
-SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
+SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
+SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
SDTG_END = SDTG_END()
[defaults]
@@ -31,6 +31,7 @@ load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
cat = SC_ADVANCED
+extra = 0