mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
windows now gets correct newlines in config
This commit is contained in:
parent
3d0c6b7f98
commit
20ede63088
|
@ -114,9 +114,15 @@ void config_save(const char *filename)
|
|||
|
||||
if (file.open_w(filename))
|
||||
{
|
||||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
const char newline[] = "\r\n";
|
||||
#else
|
||||
const char newline[] = "\n";
|
||||
#endif
|
||||
const int newline_len = sizeof(newline);
|
||||
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) { char str[256]; sprintf(str, "%s=%i", #name, config.name); file.write(str, strlen(str)); file.write("\n", 1); }
|
||||
#define MACRO_CONFIG_STR(name,len,def) { file.write(#name, strlen(#name)); file.write("=", 1); file.write(config.name, strlen(config.name)); file.write("\n", 1); }
|
||||
#define MACRO_CONFIG_INT(name,def,min,max) { char str[256]; sprintf(str, "%s=%i", #name, config.name); file.write(str, strlen(str)); file.write(newline, newline_len); }
|
||||
#define MACRO_CONFIG_STR(name,len,def) { file.write(#name, strlen(#name)); file.write("=", 1); file.write(config.name, strlen(config.name)); file.write(newline, newline_len); }
|
||||
|
||||
#include "config_variables.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue