Commit 11651ff2 authored by dscho's avatar dscho

fixed osx compiling

parent f3306e9e
...@@ -27,11 +27,13 @@ ...@@ -27,11 +27,13 @@
* *
*/ */
#include <unistd.h>
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
/* zlib doesn't like Byte already defined */ /* zlib doesn't like Byte already defined */
#undef Byte #undef Byte
#undef TRUE #undef TRUE
#undef Bool
#include "rfb.h" #include "rfb.h"
#include "keysym.h" #include "keysym.h"
...@@ -39,7 +41,7 @@ rfbScreenInfoPtr rfbScreen; ...@@ -39,7 +41,7 @@ rfbScreenInfoPtr rfbScreen;
/* some variables to enable special behaviour */ /* some variables to enable special behaviour */
int startTime = -1, maxSecsToConnect = 0; int startTime = -1, maxSecsToConnect = 0;
Bool disconnectAfterFirstClient = True; Bool disconnectAfterFirstClient = TRUE;
/* Where do I get the "official" list of Mac key codes? /* Where do I get the "official" list of Mac key codes?
Ripped these out of a Mac II emulator called Basilisk II Ripped these out of a Mac II emulator called Basilisk II
...@@ -217,10 +219,7 @@ static int keyTable[] = { ...@@ -217,10 +219,7 @@ static int keyTable[] = {
}; };
void void
KbdAddEvent(down, keySym, cl) KbdAddEvent(Bool down, KeySym keySym, struct rfbClientRec* cl)
Bool down;
KeySym keySym;
rfbClientPtr cl;
{ {
int i; int i;
CGKeyCode keyCode = -1; CGKeyCode keyCode = -1;
...@@ -289,7 +288,7 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore) ...@@ -289,7 +288,7 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore)
{ {
int i; int i;
if(startTime>0 && time()>startTime+maxSecsToConnect) if(startTime>0 && time(0)>startTime+maxSecsToConnect)
exit(0); exit(0);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
...@@ -306,7 +305,7 @@ void clientGone(rfbClientPtr cl) ...@@ -306,7 +305,7 @@ void clientGone(rfbClientPtr cl)
void newClient(rfbClientPtr cl) void newClient(rfbClientPtr cl)
{ {
if(startTime>0 && time()>startTime+maxSecsToConnect) if(startTime>0 && time(0)>startTime+maxSecsToConnect)
exit(0); exit(0);
if(disconnectAfterFirstClient) if(disconnectAfterFirstClient)
...@@ -315,10 +314,11 @@ void newClient(rfbClientPtr cl) ...@@ -315,10 +314,11 @@ void newClient(rfbClientPtr cl)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
int i;
for(i=argc-1;i>0;i--) for(i=argc-1;i>0;i--)
if(i<argc-1 && strcmp(argv[i],"-wait4client")==0) { if(i<argc-1 && strcmp(argv[i],"-wait4client")==0) {
maxSecsToConnect = atoi(argv[i+1])/1000; maxSecsToConnect = atoi(argv[i+1])/1000;
startTime = time(); startTime = time(0);
} else if(strcmp(argv[i],"-runforever")==0) { } else if(strcmp(argv[i],"-runforever")==0) {
disconnectAfterFirstClient = FALSE; disconnectAfterFirstClient = FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment