windows now gets correct newlines in config

This commit is contained in:
Jakob Fries 2007-08-10 11:22:47 +00:00
parent 3d0c6b7f98
commit 20ede63088

View file

@ -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"