From 9e5110faf702e0b44c65e40f4cde9ac525fccb13 Mon Sep 17 00:00:00 2001
From: dscho <dscho>
Date: Fri, 28 Sep 2001 09:20:50 +0000
Subject: now compiles on FreeBSD

---
 Makefile  |  2 +-
 example.c |  1 +
 rfb.h     | 20 +++++++++++---------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 6fc61c6..e12ee08 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ CFLAGS=-g -Wall
 RANLIB=ranlib
 
 INCLUDES=-I. -Iinclude
-VNCSERVERLIB=-L. -lvncserver -lz -ljpeg
+VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg
 
 # These two lines enable useage of PThreads
 #CFLAGS += -DHAVE_PTHREADS
diff --git a/example.c b/example.c
index bab1075..d2b21d5 100644
--- a/example.c
+++ b/example.c
@@ -22,6 +22,7 @@
  */
 
 #include <stdio.h>
+#include <sys/types.h>
 #include <netinet/in.h>
 #ifdef __IRIX__
 #include <netdb.h>
diff --git a/rfb.h b/rfb.h
index f17303b..384a74b 100644
--- a/rfb.h
+++ b/rfb.h
@@ -49,14 +49,21 @@ int max(int,int);
 #include <zlib.h>
 
 #include <rfbproto.h>
-#include <netinet/in.h>
+
 #ifdef HAVE_PTHREADS
 #include <pthread.h>
+#define IF_PTHREADS(x) (x)
+#else
+#define IF_PTHREADS(x)
 #endif
+
+
+
 #ifdef __linux__
 #include <endian.h>
 #else
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
+#include <sys/types.h>
 #include <machine/endian.h>
 #define _BYTE_ORDER BYTE_ORDER
 #define _LITTLE_ENDIAN LITTLE_ENDIAN
@@ -73,14 +80,9 @@ int max(int,int);
 #define _LITTLE_ENDIAN __LITTLE_ENDIAN
 #endif
 
-#define MAX_ENCODINGS 10
-
-#ifdef HAVE_PTHREADS
-#define IF_PTHREADS(x) (x)
-#else
-#define IF_PTHREADS(x)
-#endif
+#include <netinet/in.h>
 
+#define MAX_ENCODINGS 10
 
 struct rfbClientRec;
 struct rfbScreenInfo;
-- 
cgit v1.2.3

