Commit 5d222f48 authored by Chun-wei Fan's avatar Chun-wei Fan Committed by Philip Chimento

Fix building of gjs_profiler_chain_signal() on Windows

Define a macro in gjs/macros.h to denote the handler type, which is
siginfo_t* on UNIX and a void * on non-UNIX so that the code will build,
as there is no siginfo_t on Windows.

Also avoid including UNIX-only headers unconditionally.
parent 0e5478c3
......@@ -36,6 +36,7 @@ AC_LANG([C++])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_14
AC_CHECK_HEADERS([sys/syscall.h unistd.h])
LT_PREREQ([2.2.0])
# no stupid static libraries
......
......@@ -32,6 +32,7 @@
# else
# define GJS_EXPORT __declspec(dllimport)
# endif
# define siginfo_t void
#else
# define GJS_EXPORT
#endif
......
......@@ -27,11 +27,7 @@
#include <errno.h>
#include <memory>
#include <signal.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#include <glib-unix.h>
#include "jsapi-wrapper.h"
#include <js/ProfilingStack.h>
......@@ -39,9 +35,19 @@
#include "context.h"
#include "jsapi-util.h"
#include "profiler-private.h"
#ifdef ENABLE_PROFILER
# include <alloca.h>
# include "util/sp-capture-writer.h"
# ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
# endif
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
# ifdef G_OS_UNIX
# include <glib-unix.h>
# endif
# include "util/sp-capture-writer.h"
#endif
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment