Merged fixes for building on MacOS X. It dies on one file with
an internal compiler error; building that file without optimization works around the compiler bug. Sadly, synergy can only interact with X windows, not native MacOS windows.
This commit is contained in:
parent
c256cf062f
commit
17e8ba2dbd
16
acinclude.m4
16
acinclude.m4
|
@ -75,6 +75,22 @@ AC_DEFUN([ACX_CHECK_CXX_STDLIB], [
|
||||||
fi
|
fi
|
||||||
])dnl ACX_CHECK_CXX_STDLIB
|
])dnl ACX_CHECK_CXX_STDLIB
|
||||||
|
|
||||||
|
AC_DEFUN([ACX_CHECK_GETPWUID_R], [
|
||||||
|
AC_MSG_CHECKING([for working getpwuid_r])
|
||||||
|
AC_TRY_LINK([#include <pwd.h>],
|
||||||
|
[char buffer[4096]; struct passwd pwd, *pwdp;
|
||||||
|
getpwuid_r(0, &pwd, buffer, sizeof(buffer), &pwdp);],
|
||||||
|
acx_getpwuid_r_ok=yes, acx_getpwuid_r_ok=no)
|
||||||
|
AC_MSG_RESULT($acx_getpwuid_r_ok)
|
||||||
|
if test x"$acx_getpwuid_r_ok" = xyes; then
|
||||||
|
ifelse([$1],,AC_DEFINE(HAVE_GETPWUID_R,1,[Define if you have a working \`getpwuid_r\' function.]),[$1])
|
||||||
|
:
|
||||||
|
else
|
||||||
|
acx_getpwuid_r_ok=no
|
||||||
|
$2
|
||||||
|
fi
|
||||||
|
])dnl ACX_CHECK_GETPWUID_R
|
||||||
|
|
||||||
AC_DEFUN([ACX_CHECK_POLL], [
|
AC_DEFUN([ACX_CHECK_POLL], [
|
||||||
AC_MSG_CHECKING([for poll])
|
AC_MSG_CHECKING([for poll])
|
||||||
AC_TRY_LINK([#include <sys/poll.h>],
|
AC_TRY_LINK([#include <sys/poll.h>],
|
||||||
|
|
|
@ -46,14 +46,17 @@ AC_CHECK_HEADERS([windows.h])
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_PATH_X
|
AC_PATH_X
|
||||||
AC_PATH_XTRA
|
AC_PATH_XTRA
|
||||||
|
save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
||||||
AC_CHECK_HEADERS([X11/extensions/XTest.h])
|
AC_CHECK_HEADERS([X11/extensions/XTest.h])
|
||||||
|
CPPFLAGS="$save_CPPFLAGS"
|
||||||
|
|
||||||
dnl checks for types
|
dnl checks for types
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
|
||||||
dnl checks for structures
|
dnl checks for structures
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
AC_CHECK_TYPES(mbstate_t,,,[#include <wchar.h>])
|
AC_CHECK_TYPES(mbstate_t,,,[#include <cwchar>])
|
||||||
|
|
||||||
dnl checks for compiler characteristics
|
dnl checks for compiler characteristics
|
||||||
AC_CHECK_SIZEOF(char, 1)
|
AC_CHECK_SIZEOF(char, 1)
|
||||||
|
@ -72,7 +75,7 @@ AC_FUNC_FORK
|
||||||
AC_FUNC_MEMCMP
|
AC_FUNC_MEMCMP
|
||||||
AC_FUNC_STRFTIME
|
AC_FUNC_STRFTIME
|
||||||
AC_CHECK_FUNCS(gmtime_r)
|
AC_CHECK_FUNCS(gmtime_r)
|
||||||
AC_CHECK_FUNCS(getpwuid_r)
|
ACX_CHECK_GETPWUID_R
|
||||||
AC_CHECK_FUNCS(vsnprintf)
|
AC_CHECK_FUNCS(vsnprintf)
|
||||||
AC_CHECK_FUNCS(wcrtomb mbrtowc mbsinit)
|
AC_CHECK_FUNCS(wcrtomb mbrtowc mbsinit)
|
||||||
AC_FUNC_SELECT_ARGTYPES
|
AC_FUNC_SELECT_ARGTYPES
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include "CString.h"
|
#include "CString.h"
|
||||||
#include "BasicTypes.h"
|
#include "BasicTypes.h"
|
||||||
#include <wchar.h>
|
#include <cwchar>
|
||||||
|
|
||||||
//! Unicode utility functions
|
//! Unicode utility functions
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -19,6 +19,13 @@
|
||||||
#include "CString.h"
|
#include "CString.h"
|
||||||
#include "stdvector.h"
|
#include "stdvector.h"
|
||||||
|
|
||||||
|
// Darwin is so unsure what to use for socklen_t it makes us choose
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
# if !defined(_BSD_SOCKLEN_T_)
|
||||||
|
# define _BSD_SOCKLEN_T_ int
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_TYPES_H
|
#if HAVE_SYS_TYPES_H
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -141,7 +141,11 @@ CUnixPlatform::getUserDirectory() const
|
||||||
#if HAVE_GETPWUID_R
|
#if HAVE_GETPWUID_R
|
||||||
struct passwd pwent;
|
struct passwd pwent;
|
||||||
struct passwd* pwentp;
|
struct passwd* pwentp;
|
||||||
|
#if defined(_SC_GETPW_R_SIZE_MAX)
|
||||||
long size = sysconf(_SC_GETPW_R_SIZE_MAX);
|
long size = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||||
|
#else
|
||||||
|
long size = BUFSIZ;
|
||||||
|
#endif
|
||||||
char* buffer = new char[size];
|
char* buffer = new char[size];
|
||||||
getpwuid_r(getuid(), &pwent, buffer, size, &pwentp);
|
getpwuid_r(getuid(), &pwent, buffer, size, &pwentp);
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
|
Loading…
Reference in New Issue