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:
crs 2002-11-03 18:09:28 +00:00
parent c256cf062f
commit 17e8ba2dbd
5 changed files with 33 additions and 3 deletions

View File

@ -75,6 +75,22 @@ AC_DEFUN([ACX_CHECK_CXX_STDLIB], [
fi
])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_MSG_CHECKING([for poll])
AC_TRY_LINK([#include <sys/poll.h>],

View File

@ -46,14 +46,17 @@ AC_CHECK_HEADERS([windows.h])
AC_HEADER_TIME
AC_PATH_X
AC_PATH_XTRA
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
AC_CHECK_HEADERS([X11/extensions/XTest.h])
CPPFLAGS="$save_CPPFLAGS"
dnl checks for types
AC_TYPE_SIZE_T
dnl checks for structures
AC_STRUCT_TM
AC_CHECK_TYPES(mbstate_t,,,[#include <wchar.h>])
AC_CHECK_TYPES(mbstate_t,,,[#include <cwchar>])
dnl checks for compiler characteristics
AC_CHECK_SIZEOF(char, 1)
@ -72,7 +75,7 @@ AC_FUNC_FORK
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(getpwuid_r)
ACX_CHECK_GETPWUID_R
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(wcrtomb mbrtowc mbsinit)
AC_FUNC_SELECT_ARGTYPES

View File

@ -17,7 +17,7 @@
#include "CString.h"
#include "BasicTypes.h"
#include <wchar.h>
#include <cwchar>
//! Unicode utility functions
/*!

View File

@ -19,6 +19,13 @@
#include "CString.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
# include <sys/types.h>
#endif

View File

@ -141,7 +141,11 @@ CUnixPlatform::getUserDirectory() const
#if HAVE_GETPWUID_R
struct passwd pwent;
struct passwd* pwentp;
#if defined(_SC_GETPW_R_SIZE_MAX)
long size = sysconf(_SC_GETPW_R_SIZE_MAX);
#else
long size = BUFSIZ;
#endif
char* buffer = new char[size];
getpwuid_r(getuid(), &pwent, buffer, size, &pwentp);
delete[] buffer;