diff -Naur pwlib/src/ptclib/pdns.cxx pwlib-patched/src/ptclib/pdns.cxx
--- pwlib/src/ptclib/pdns.cxx	Mon Apr 28 19:57:40 2003
+++ pwlib-patched/src/ptclib/pdns.cxx	Fri Feb 13 22:57:45 2004
@@ -72,6 +72,7 @@
 #if P_HAS_RESOLVER
 #include <arpa/nameser.h>
 #include <resolv.h>
+#include <arpa/nameser_compat.h>
 #endif
 
 #endif
--- pwlib/include/ptlib/unix/ptlib/pmachdep.h.old	2005-06-22 09:49:50.000000000 -0400
+++ pwlib/include/ptlib/unix/ptlib/pmachdep.h	2005-06-22 09:50:33.000000000 -0400
@@ -445,8 +445,6 @@
 #include <netinet/tcp.h>
 #include <sys/ioctl.h>
  
-typedef int socklen_t;
- 
 #define HAS_IFREQ
  
 #define PSETPGRP()  setpgrp(0, 0)
--- pwlib/src/ptlib/unix/udll.cxx.old	2005-06-22 10:35:45.000000000 -0400
+++ pwlib/src/ptlib/unix/udll.cxx	2005-06-22 10:35:11.000000000 -0400
@@ -80,7 +80,11 @@
 
 #include <ptlib.h>
 
-#ifdef P_MACOSX
+#if 1
+# include <dlfcn.h>
+#endif
+
+#if 0
 
 /*
 Copyright (c) 2002 Peter O'Gorman <ogorman@users.sourceforge.net>
--- pwlib/src/ptlib/unix/Makefile.old	2005-06-22 23:58:34.000000000 -0400
+++ pwlib/src/ptlib/unix/Makefile	2005-06-22 23:58:57.000000000 -0400
@@ -601,11 +601,13 @@
 	$(COMMON_SRC_DIR)/contain.cxx \
 	$(COMMON_SRC_DIR)/object.cxx   # must be last module
 
+ifneq ($(OSTYPE),Darwin)
 ifneq ($(OSTYPE),Carbon)
 ifneq ($(OSTYPE),linux)
 OBJS	= $(OBJDIR)/regcomp.o $(OBJDIR)/regexec.o $(OBJDIR)/regerror.o $(OBJDIR)/regfree.o
 endif
 endif
+endif
 
 CLEAN_FILES = $(GETDATE_SOURCE)
 
--- pwlib/src/ptclib/udp.cxx.orig	2005-07-18 17:45:19.000000000 -0400
+++ pwlib/src/ptclib/udp.cxx	2005-07-18 17:45:36.000000000 -0400
@@ -215,11 +215,7 @@
    int originalSize = *len;
 
    struct sockaddr_in from;
-#ifdef P_MACOSX
-   int fromLen = sizeof(from);
-#else
    socklen_t fromLen = sizeof(from);
-#endif
 
    *len = recvfrom(fd,
                    buf,
--- pwlib/src/ptclib/pssl.cxx.orig	2005-07-18 17:58:16.000000000 -0400
+++ pwlib/src/ptclib/pssl.cxx	2005-07-18 17:59:29.000000000 -0400
@@ -751,7 +751,8 @@
 
   switch (fileType) {
     case PSSLFileTypeASN1 :
-      dh = d2i_DHparams_bio(in, NULL);
+      dh = (DH *)ASN1_d2i_bio((char *(*)(...))DH_new,
+                (char *(*)(...))d2i_DHparams,in,NULL);
       if (dh != NULL)
         return TRUE;
 
