cygwin: fix errors with GCC 5

GCC 5 switched from C89 to C11 by default. This implies a change from
GNU to C99 inline by default, which have very different meanings of
extern inline vs. static inline:

https://gcc.gnu.org/onlinedocs/gcc/Inline.html

Marking these as gnu_inline retains the previous behaviour.

	winsup/cygwin/
	* exceptions.cc (exception::handle): Change debugging to int to fix
	an always-true boolean comparison warning.
	* include/cygwin/config.h (__getreent): Mark gnu_inline.
	* winbase.h (ilockcmpexch, ilockcmpexch64): Ditto.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
Yaakov Selkowitz 2016-02-12 11:17:35 -06:00
parent ac2f9e23ec
commit c5f03820fc
3 changed files with 5 additions and 2 deletions

View File

@ -637,7 +637,7 @@ EXCEPTION_DISPOSITION
exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
PDISPATCHER_CONTEXT dispatch) PDISPATCHER_CONTEXT dispatch)
{ {
static bool NO_COPY debugging; static int NO_COPY debugging = 0;
_cygtls& me = _my_tls; _cygtls& me = _my_tls;
#ifndef __x86_64__ #ifndef __x86_64__
@ -808,7 +808,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
rtl_unwind (frame, e); rtl_unwind (frame, e);
else else
{ {
debugging = true; debugging = 1;
return ExceptionContinueExecution; return ExceptionContinueExecution;
} }

View File

@ -43,6 +43,7 @@ extern "C" {
#else #else
#include "../tlsoffsets.h" #include "../tlsoffsets.h"
#endif #endif
__attribute__((gnu_inline))
extern inline struct _reent *__getreent (void) extern inline struct _reent *__getreent (void)
{ {
register char *ret; register char *ret;

View File

@ -11,6 +11,7 @@ details. */
#ifndef _WINBASE2_H #ifndef _WINBASE2_H
#define _WINBASE2_H #define _WINBASE2_H
__attribute__((gnu_inline))
extern __inline__ LONG extern __inline__ LONG
ilockcmpexch (volatile LONG *t, LONG v, LONG c) ilockcmpexch (volatile LONG *t, LONG v, LONG c)
{ {
@ -30,6 +31,7 @@ ilockcmpexch (volatile LONG *t, LONG v, LONG c)
#undef InterlockedCompareExchangePointer #undef InterlockedCompareExchangePointer
#ifdef __x86_64__ #ifdef __x86_64__
__attribute__((gnu_inline))
extern __inline__ LONGLONG extern __inline__ LONGLONG
ilockcmpexch64 (volatile LONGLONG *t, LONGLONG v, LONGLONG c) ilockcmpexch64 (volatile LONGLONG *t, LONGLONG v, LONGLONG c)
{ {