aboutsummaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>1999-09-11 17:54:18 +0000
committerAndy Polyakov <appro@openssl.org>1999-09-11 17:54:18 +0000
commit17f389bbbfccf057a8bc04084ed068c4b368e751 (patch)
tree7daa85ce7f0f44aff61853dc10c5915d465ba43c /e_os.h
parent5bdae1675c8b450bed091b9605ae9d10d61adfc7 (diff)
downloadopenssl-17f389bbbfccf057a8bc04084ed068c4b368e751.tar.gz
Initial support for MacOS.
This will soon be complemented with MacOS specific source code files and INSTALL.MacOS. I (Andy) have decided to get rid of a number of #include <sys/types.h>. I've verified it's ok (both by examining /usr/include/*.h and compiling) on a number of Unix platforms. Unfortunately I don't have Windows box to verify this on. I really appreciate if somebody could try to compile it and contact me a.s.a.p. in case a problem occurs. Submitted by: Roy Wood <roy@centricsystems.ca> Reviewed by: Andy Polyakov <appro@fy.chalmers.se>
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/e_os.h b/e_os.h
index 5eaa3cca1b..61ff56eec7 100644
--- a/e_os.h
+++ b/e_os.h
@@ -82,6 +82,15 @@ extern "C" {
#define DEVRANDOM "/dev/urandom"
#endif
+#if defined(__MWERKS__) && defined(macintosh)
+# if macintosh==1
+# define MAC_OS_pre_X
+# define NO_SYS_TYPES_H
+# define NO_CHMOD
+# define NO_SYSLOG
+# endif
+#endif
+
/********************************************************************
The Microsoft section
********************************************************************/
@@ -119,6 +128,12 @@ extern "C" {
#define readsocket(s,b,n) recv((s),(b),(n),0)
#define writesocket(s,b,n) send((s),(b),(n),0)
#define EADDRINUSE WSAEADDRINUSE
+#elif MAC_OS_pre_X
+#define get_last_socket_error() errno
+#define clear_socket_error() errno=0
+#define closesocket(s) MacSocket_close(s)
+#define readsocket(s,b,n) MacSocket_recv((s),(b),(n),true)
+#define writesocket(s,b,n) MacSocket_send((s),(b),(n))
#else
#define get_last_socket_error() errno
#define clear_socket_error() errno=0
@@ -268,6 +283,13 @@ extern HINSTANCE _hInstance;
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
# endif
+# elif defined(MAC_OS_pre_X)
+
+# include "MacSocket.h"
+# define SSLeay_Write(a,b,c) MacSocket_send((a),(b),(c))
+# define SSLeay_Read(a,b,c) MacSocket_recv((a),(b),(c),true)
+# define SHUTDOWN(fd) MacSocket_close(fd)
+# define SHUTDOWN2(fd) MacSocket_close(fd)
# else