diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-10-22 01:59:09 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-10-22 01:59:09 +0200 |
commit | 89580f2113a190494afd7e9454bad5275beda4c6 (patch) | |
tree | f943a49b7ae97e0fbd4d5d9c315099190f24e150 /src | |
parent | c7b9d657977ae907aeacc40b1eca2cbfcbddb35c (diff) | |
download | tdv-89580f2113a190494afd7e9454bad5275beda4c6.tar.gz tdv-89580f2113a190494afd7e9454bad5275beda4c6.tar.xz tdv-89580f2113a190494afd7e9454bad5275beda4c6.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/sdgui.c | 1 | ||||
-rw-r--r-- | src/utils.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/sdgui.c b/src/sdgui.c index 127f01b..5b898c7 100644 --- a/src/sdgui.c +++ b/src/sdgui.c @@ -20,6 +20,7 @@ #include <glib/gi18n.h> #include <locale.h> +#include <stdlib.h> #include "config.h" #include "stardict.h" 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 <p@janouch.name> + * Copyright (c) 2013 - 2021, Přemysl Eric Janouch <p@janouch.name> * * 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 <errno.h> #include <stdarg.h> +#ifndef WIN32 #include <pwd.h> +#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 * |