Fixed Issue #20: Compiling with gcc > 4.3 failes
This commit is contained in:
parent
3580a29fd8
commit
b3cf31bd7c
|
@ -19,6 +19,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// CArchDaemonUnix
|
||||
|
@ -37,6 +38,8 @@ CArchDaemonUnix::~CArchDaemonUnix()
|
|||
int
|
||||
CArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
|
||||
{
|
||||
int dummy;
|
||||
|
||||
// fork so shell thinks we're done and so we're not a process
|
||||
// group leader
|
||||
switch (fork()) {
|
||||
|
@ -57,7 +60,7 @@ CArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
|
|||
setsid();
|
||||
|
||||
// chdir to root so we don't keep mounted filesystems points busy
|
||||
chdir("/");
|
||||
dummy = chdir("/");
|
||||
|
||||
// mask off permissions for any but owner
|
||||
umask(077);
|
||||
|
@ -71,7 +74,7 @@ CArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
|
|||
// of standard I/O safely goes in the bit bucket.
|
||||
open("/dev/null", O_RDONLY);
|
||||
open("/dev/null", O_RDWR);
|
||||
dup(1);
|
||||
dummy = dup(1);
|
||||
|
||||
// invoke function
|
||||
return func(1, &name);
|
||||
|
|
|
@ -316,8 +316,10 @@ CArchNetworkBSD::pollSocket(CPollEntry pe[], int num, double timeout)
|
|||
if (n > 0 && unblockPipe != NULL && (pfd[num].revents & POLLIN) != 0) {
|
||||
// the unblock event was signalled. flush the pipe.
|
||||
char dummy[100];
|
||||
int ignore;
|
||||
|
||||
do {
|
||||
read(unblockPipe[0], dummy, sizeof(dummy));
|
||||
ignore = read(unblockPipe[0], dummy, sizeof(dummy));
|
||||
} while (errno != EAGAIN);
|
||||
|
||||
// don't count this unblock pipe in return value
|
||||
|
@ -489,7 +491,9 @@ CArchNetworkBSD::unblockPollSocket(CArchThread thread)
|
|||
const int* unblockPipe = getUnblockPipeForThread(thread);
|
||||
if (unblockPipe != NULL) {
|
||||
char dummy = 0;
|
||||
write(unblockPipe[1], &dummy, 1);
|
||||
int ignore;
|
||||
|
||||
ignore = write(unblockPipe[1], &dummy, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@
|
|||
|
||||
#include "common.h"
|
||||
#include "CArch.h"
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#if HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
@ -26,7 +27,7 @@
|
|||
# include <wchar.h>
|
||||
#elif __APPLE__
|
||||
// wtf? Darwin puts mbtowc() et al. in stdlib
|
||||
# include <stdlib.h>
|
||||
# include <cstdlib>
|
||||
#else
|
||||
// platform apparently has no wchar_t support. provide dummy
|
||||
// implementations. hopefully at least the C++ compiler has
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "XArchUnix.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
//
|
||||
// XArchEvalUnix
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <cctype>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "CUnicode.h"
|
||||
#include "CArch.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
//
|
||||
// local utility functions
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "CLog.h"
|
||||
#include "IEventQueue.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// CClient
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "TMethodEventJob.h"
|
||||
#include "XBase.h"
|
||||
#include <memory>
|
||||
#include <cstring>
|
||||
|
||||
//
|
||||
// CServerProxy
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
#include "IEventJob.h"
|
||||
#include "CArch.h"
|
||||
#include "XArch.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
|
||||
//
|
||||
// CTCPSocket
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "IEventQueue.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include "CLog.h"
|
||||
#include "IEventQueue.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
|
||||
//
|
||||
// CClientProxy1_3
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "XSocket.h"
|
||||
#include "stdistream.h"
|
||||
#include "stdostream.h"
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// CConfig
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include "CEventQueue.h"
|
||||
#include "CLog.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Input Filter Condition Classes
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include "CLog.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include "CArch.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// CServer
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include "KeyTypes.h"
|
||||
#include "CLog.h"
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
|
||||
CKeyMap::CNameToKeyMap* CKeyMap::s_nameToKeyMap = NULL;
|
||||
CKeyMap::CNameToModifierMap* CKeyMap::s_nameToModifierMap = NULL;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "CKeyState.h"
|
||||
#include "IEventQueue.h"
|
||||
#include "CLog.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
static const KeyButton kButtonMask = (KeyButton)(IKeyState::kNumButtons - 1);
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include "IEventQueue.h"
|
||||
#include "CLock.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
|
||||
//
|
||||
// CPacketStreamFilter
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
*/
|
||||
|
||||
#include "IKeyState.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// IKeyState
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "IPrimaryScreen.h"
|
||||
#include <cstdlib>
|
||||
|
||||
//
|
||||
// IPrimaryScreen
|
||||
|
|
Loading…
Reference in New Issue