aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcConfig.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-28 00:37:42 -0700
committerChris Robinson <[email protected]>2014-03-28 00:37:42 -0700
commit20886059fd88724f724da8601a82e04fc3f03a53 (patch)
tree0f8c147ad311226ea9983d73e9ca18faade84e8f /Alc/alcConfig.c
parent18620ab5e00fb4cba97f3aa2bfbc677dfe8376ef (diff)
Wrap fopen calls under Windows
The idea is that all filenames we deal with are encoded as UTF-8, but the Windows functions that take a char string interpret it using the ANSI codepage. So instead, we convert the UTF-8 string to a wchar string, and then use the wchar functions for proper extended character filename support.
Diffstat (limited to 'Alc/alcConfig.c')
-rw-r--r--Alc/alcConfig.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c
index 740d0f86..41416a18 100644
--- a/Alc/alcConfig.c
+++ b/Alc/alcConfig.c
@@ -32,13 +32,13 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
-
-#include "alMain.h"
-
#ifdef _WIN32_IE
#include <shlobj.h>
#endif
+#include "alMain.h"
+#include "compat.h"
+
typedef struct ConfigEntry {
char *key;
@@ -304,7 +304,7 @@ void ReadALConfig(void)
snprintf(buffer+p, sizeof(buffer)-p, "\\alsoft.ini");
TRACE("Loading config %s...\n", buffer);
- f = fopen(buffer, "rt");
+ f = al_fopen(buffer, "rt");
if(f)
{
LoadConfigFromFile(f);
@@ -315,7 +315,7 @@ void ReadALConfig(void)
str = "/etc/openal/alsoft.conf";
TRACE("Loading config %s...\n", str);
- f = fopen(str, "r");
+ f = al_fopen(str, "r");
if(f)
{
LoadConfigFromFile(f);
@@ -346,7 +346,7 @@ void ReadALConfig(void)
buffer[sizeof(buffer)-1] = 0;
TRACE("Loading config %s...\n", next);
- f = fopen(next, "r");
+ f = al_fopen(next, "r");
if(f)
{
LoadConfigFromFile(f);
@@ -362,7 +362,7 @@ void ReadALConfig(void)
snprintf(buffer, sizeof(buffer), "%s/.alsoftrc", str);
TRACE("Loading config %s...\n", buffer);
- f = fopen(buffer, "r");
+ f = al_fopen(buffer, "r");
if(f)
{
LoadConfigFromFile(f);
@@ -381,7 +381,7 @@ void ReadALConfig(void)
if(buffer[0] != 0)
{
TRACE("Loading config %s...\n", buffer);
- f = fopen(buffer, "r");
+ f = al_fopen(buffer, "r");
if(f)
{
LoadConfigFromFile(f);
@@ -393,7 +393,7 @@ void ReadALConfig(void)
if((str=getenv("ALSOFT_CONF")) != NULL && *str)
{
TRACE("Loading config %s...\n", str);
- f = fopen(str, "r");
+ f = al_fopen(str, "r");
if(f)
{
LoadConfigFromFile(f);