Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions gdb/common/enum-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@

#ifdef __cplusplus

#if __cplusplus >= 201103L
#include <type_traits>
#endif

/* Traits type used to prevent the global operator overloads from
instantiating for non-flag enums. */
template<typename T> struct enum_flags_type {};
Expand All @@ -66,6 +70,7 @@ template<typename T> struct enum_flags_type {};
typedef enum_flags<enum_type> type; \
}

#if __cplusplus < 201103L
/* Until we can rely on std::underlying type being universally
available (C++11), roll our own for enums. */
template<int size, bool sign> class integer_for_size { typedef void type; };
Expand All @@ -85,6 +90,13 @@ struct enum_underlying_type
integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
type;
};
#else
template<typename T>
struct enum_underlying_type
{
typedef typename std::underlying_type<T>::type type;
};
#endif

template <typename E>
class enum_flags
Expand Down
13 changes: 7 additions & 6 deletions readline/rltty.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@

#include "rldefs.h"

#if defined (GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL */
#include <sys/ioctl.h>

#include "rltty.h"
#include "readline.h"
Expand Down Expand Up @@ -238,9 +236,12 @@ prepare_terminal_settings (meta_flag, oldtio, tiop)
TIOTYPE oldtio, *tiop;
{
_rl_echoing_p = (oldtio.sgttyb.sg_flags & ECHO);
_rl_echoctl = (oldtio.sgttyb.sg_flags & ECHOCTL);

/* Copy the original settings to the structure we're going to use for
#if defined(ECHOCTL)
_rl_echoctl = (oldtio.c_lflag & ECHOCTL);
#else
_rl_echoctl = 0; /* macOS or systems without ECHOCTL */
#endif
/* Copy the original settings to the structure we're going to use for
our settings. */
tiop->sgttyb = oldtio.sgttyb;
tiop->lflag = oldtio.lflag;
Expand Down
1 change: 1 addition & 0 deletions readline/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#endif

#include <stdio.h>
#include <sys/ioctl.h>

/* System-specific feature definitions and include files. */
#include "rldefs.h"
Expand Down
16 changes: 14 additions & 2 deletions zlib/zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@

#include "zlib.h"

/* Fix for macOS: prevent fdopen redefinition conflicts */
#ifdef fdopen
#undef fdopen
#endif
#define fdopen(fd,mode) fdopen(fd,mode)

#if defined(STDC) && !defined(Z_SOLO)
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h>
Expand Down Expand Up @@ -119,18 +125,24 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif

#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
# define OS_CODE 0x07

# ifndef Z_SOLO
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifdef fdopen
# undef fdopen
# endif
# define fdopen(fd, mode) NULL /* No fdopen() */
# endif
# endif
# endif

#endif


#ifdef TOPS20
# define OS_CODE 0x0a
#endif
Expand Down