summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/core-util.c8
-rw-r--r--src/pulsecore/macro.h8
2 files changed, 11 insertions, 5 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 13a7252c..d37a11cc 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -100,10 +100,8 @@
#ifndef OS_IS_WIN32
#define PA_USER_RUNTIME_PATH_PREFIX "/tmp/pulse-"
-#define PATH_SEP '/'
#else
#define PA_USER_RUNTIME_PATH_PREFIX "%TEMP%\\pulse-"
-#define PATH_SEP '\\'
#endif
#ifdef OS_IS_WIN32
@@ -118,7 +116,7 @@ int pa_set_root(HANDLE handle) {
if (!GetModuleFileName(handle, library_path + sizeof(PULSE_ROOTENV), MAX_PATH))
return 0;
- sep = strrchr(library_path, '\\');
+ sep = strrchr(library_path, PA_PATH_SEP_CHAR);
if (sep)
*sep = '\0';
@@ -1123,7 +1121,7 @@ char *pa_runtime_path(const char *fn, char *s, size_t l) {
if ((e = getenv("PULSE_RUNTIME_PATH"))) {
if (fn)
- pa_snprintf(s, l, "%s%c%s", e, PATH_SEP, fn);
+ pa_snprintf(s, l, "%s%c%s", e, PA_PATH_SEP_CHAR, fn);
else
pa_snprintf(s, l, "%s", e);
@@ -1131,7 +1129,7 @@ char *pa_runtime_path(const char *fn, char *s, size_t l) {
char u[256];
if (fn)
- pa_snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)), PATH_SEP, fn);
+ pa_snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)), PA_PATH_SEP_CHAR, fn);
else
pa_snprintf(s, l, "%s%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)));
}
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index c1bdb140..c46ae524 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -114,4 +114,12 @@ static inline size_t pa_page_align(size_t l) {
#define PA_PTR_TO_INT32(p) ((int32_t) PA_PTR_TO_UINT(p))
#define PA_INT32_TO_PTR(u) PA_UINT_TO_PTR((int32_t) u)
+#ifdef OS_IS_WIN32
+#define PA_PATH_SEP "\\"
+#define PA_PATH_SEP_CHAR '\\'
+#else
+#define PA_PATH_SEP "/"
+#define PA_PATH_SEP_CHAR '/'
+#endif
+
#endif