From 89580f2113a190494afd7e9454bad5275beda4c6 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Fri, 22 Oct 2021 01:59:09 +0200 Subject: sdgui: cross-compile for Windows No one bothered to ask whether it /should/ be done. The hamburger needs to be replaced with a file open dialog there. --- src/utils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 367c0f5..6a32bda 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,7 +1,7 @@ /* * utils.c: miscellaneous utilities * - * Copyright (c) 2013 - 2020, Přemysl Eric Janouch + * Copyright (c) 2013 - 2021, Přemysl Eric Janouch * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted. @@ -25,7 +25,9 @@ #include #include +#ifndef WIN32 #include +#endif // ! WIN32 #include "config.h" #include "utils.h" @@ -161,6 +163,10 @@ try_expand_tilde (const gchar *filename) if (!until_slash) return g_build_filename (g_get_home_dir () ?: "", filename, NULL); +#ifdef WIN32 + // TODO: also ensure that path separators are handled sensibly around here + return NULL; +#else // ! WIN32 long buf_len = sysconf (_SC_GETPW_R_SIZE_MAX); if (buf_len < 0) buf_len = 1024; @@ -177,6 +183,7 @@ try_expand_tilde (const gchar *filename) result = g_strdup_printf ("%s%s", pwd.pw_dir, filename + until_slash); g_free (buf); return result; +#endif // ! WIN32 } gchar * -- cgit v1.2.3-70-g09d2