/* Signal handler for sampling profiler. */
+/* timer_getoverrun is not implemented on Cygwin, but the following
+ seems to be good enough for profiling. */
+#ifdef CYGWIN
+#define timer_getoverrun(x) 0
+#endif
+
static void
handle_profiler_signal (int signal)
{
#define FORWARD_SIGNAL_TO_MAIN_THREAD
#endif
+/* On Cygwin as of 2015-06-22 SIGEV_SIGNAL is defined as an enum
+ constant but not as a macro. */
+#if defined CYGWIN && !defined SIGEV_SIGNAL
+#define SIGEV_SIGNAL SIGEV_SIGNAL
+#endif
+
#if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL
# define HAVE_ITIMERSPEC
#endif
-/* On Cygwin, setitimer does not support ITIMER_PROF, so we can't
- support CPU profiling. */
-#if (defined SIGPROF && !defined PROFILING && !defined CYGWIN \
+#if (defined SIGPROF && !defined PROFILING \
&& (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC))
# define PROFILER_CPU_SUPPORT
#endif