commit fef0cbd96a5ff6233d8578cd69dda330eb1196d9
parent 10d7193abc58f31534e88e680081967469f755f2
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date: Mon, 13 Sep 2021 00:30:27 -0700
GPid is a HANDLE on Windows
Diffstat:
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/compose.c b/src/compose.c
@@ -200,6 +200,12 @@ typedef enum {
"message.")); \
}
+#ifdef G_OS_WIN32
+#define INVALID_PID INVALID_HANDLE_VALUE
+#else
+#define INVALID_PID -1
+#endif
+
static GdkColor default_header_bgcolor = {
(gulong)0,
(gushort)0,
@@ -8276,7 +8282,7 @@ static Compose *compose_create(PrefsAccount *account,
compose->sig_str = NULL;
compose->exteditor_file = NULL;
- compose->exteditor_pid = -1;
+ compose->exteditor_pid = INVALID_PID;
compose->exteditor_tag = -1;
compose->exteditor_socket = NULL;
compose->draft_timeout_tag = COMPOSE_DRAFT_TIMEOUT_FORBIDDEN; /* inhibit auto-drafting while loading */
@@ -9770,7 +9776,7 @@ static void compose_ext_editor_closed_cb(GPid pid, gint exit_status, gpointer da
g_free(compose->exteditor_file);
compose->exteditor_file = NULL;
- compose->exteditor_pid = -1;
+ compose->exteditor_pid = INVALID_PID;
compose->exteditor_tag = -1;
if (compose->exteditor_socket) {
gtk_widget_destroy(compose->exteditor_socket);
@@ -9814,7 +9820,7 @@ static gboolean compose_ext_editor_kill(Compose *compose)
msg = g_strdup_printf
(_("The external editor is still working.\n"
"Force terminating the process?\n"
- "process id: %d"), pid);
+ "process id: %" G_PID_FORMAT), pid);
val = alertpanel_full(_("Notice"), msg, GTK_STOCK_NO,
GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
FALSE, NULL, ALERT_WARNING);
@@ -9831,7 +9837,7 @@ static gboolean compose_ext_editor_kill(Compose *compose)
waitpid(compose->exteditor_pid, NULL, 0);
#endif /* G_OS_WIN32 */
- g_warning("terminated process id: %d, "
+ g_warning("terminated process id: %" G_PID_FORMAT ", "
"temporary file: %s", pid, compose->exteditor_file);
g_spawn_close_pid(compose->exteditor_pid);
@@ -9839,7 +9845,7 @@ static gboolean compose_ext_editor_kill(Compose *compose)
g_free(compose->exteditor_file);
compose->exteditor_file = NULL;
- compose->exteditor_pid = -1;
+ compose->exteditor_pid = INVALID_PID;
compose->exteditor_tag = -1;
} else
return FALSE;