summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-11-18 17:08:39 -0700
committerJose Fonseca <[email protected]>2015-11-19 07:57:09 +0000
commit1cfffb95ebf49a8342d4799e68ecc0009300cb2f (patch)
treeee6cc8ede96f7c4d4224f2be016c1e96169214eb /src
parent2f554761536bbfd0d8ec22e807c18bd6df0f22b8 (diff)
hud: fix Windows build break
Protect signal-related code with PIPE_OS_UNIX test. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index a055480646d..24a68dd2574 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -98,11 +98,13 @@ struct hud_context {
} text, bg, whitelines;
};
+#ifdef PIPE_OS_UNIX
static void
signal_visible_handler(int sig, siginfo_t *siginfo, void *context)
{
huds_visible = !huds_visible;
}
+#endif
static void
hud_draw_colored_prims(struct hud_context *hud, unsigned prim,
@@ -1137,8 +1139,10 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
unsigned i;
const char *env = debug_get_option("GALLIUM_HUD", NULL);
unsigned signo = debug_get_num_option("GALLIUM_HUD_TOGGLE_SIGNAL", 0);
+#ifdef PIPE_OS_UNIX
static boolean sig_handled = FALSE;
struct sigaction action = {};
+#endif
huds_visible = debug_get_bool_option("GALLIUM_HUD_VISIBLE", TRUE);
if (!env || !*env)
@@ -1283,6 +1287,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
LIST_INITHEAD(&hud->pane_list);
/* setup sig handler once for all hud contexts */
+#ifdef PIPE_OS_UNIX
if (!sig_handled && signo != 0) {
action.sa_sigaction = &signal_visible_handler;
action.sa_flags = SA_SIGINFO;
@@ -1295,6 +1300,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
sig_handled = TRUE;
}
+#endif
hud_parse_env_var(hud, env);
return hud;