Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4552)
+++ ChangeLog	(revision 4554)
@@ -15,4 +15,5 @@
 	* Added support for single sink mode (Closes: #25)
 	* Implemented atomic flag toggling and flag protection.
+	* Started porting to OpenVMS (See #24)
 
 v. 0.4beta0 - Fri Oct 01 2010 13:36 CEST
Index: configure
===================================================================
--- configure	(revision 4489)
+++ configure	(revision 4554)
@@ -1271,4 +1271,5 @@
 test_lib_defmake ROAR_HAVE_H_STDINT      %            stdint.h      c          -- stdint.h
 test_lib_defmake ROAR_HAVE_H_STRING      %            string.h      c          -- string.h
+test_lib_defmake ROAR_HAVE_H_SYS_SOCKET  %            sys/socket.h  c          -- sys/socket.h
 test_lib_defmake ROAR_HAVE_H_SYS_TYPES   %            sys/types.h   c          -- sys/types.h
 test_lib_defmake ROAR_HAVE_H_SYS_TIME    %            sys/time.h    c          -- sys/time.h
@@ -1366,4 +1367,6 @@
 test_func_defmake ROAR_HAVE_RAND_R    rand_r    'rand_r((unsigned int*)0)'   -- stdlib.h
 test_func_defmake ROAR_HAVE_SRAND     srand     'srand((unsigned int)0)'     -- stdlib.h
+test_func_defmake ROAR_HAVE_FCNTL     fcntl     'fcntl(0, 0)'                -- unistd.h fcntl.h
+
 
 echo -n 'checking for basic IO calls... '
Index: include/libroar/libroar.h
===================================================================
--- include/libroar/libroar.h	(revision 4533)
+++ include/libroar/libroar.h	(revision 4554)
@@ -62,5 +62,7 @@
 
 #ifndef ROAR_TARGET_WIN32
+#ifdef ROAR_HAVE_H_SYS_SOCKET
 #include <sys/socket.h>
+#endif
 #ifdef ROAR_HAVE_IPV4
 #include <netinet/in_systm.h>
Index: include/roaraudio.h
===================================================================
--- include/roaraudio.h	(revision 4494)
+++ include/roaraudio.h	(revision 4554)
@@ -48,5 +48,8 @@
 #endif
 
+#ifdef ROAR_HAVE_H_STDINT
 #include <stdint.h>
+#endif
+
 #include <stdlib.h>
 
@@ -84,5 +87,5 @@
 #endif
 
-#ifdef ROAR_HAVE_SELECT
+#ifdef ROAR_HAVE_H_SYS_SOCKET
 #include <sys/socket.h>
 #endif
@@ -264,5 +267,10 @@
 #define ROAR_DBG_INFO_VERBOSE          3
 
-#if __GNUC__ < 3
+#if !defined(__GNUC__)
+ #define ROAR_DBG(format, ...)
+ #define ROAR_ERR(format, ...)
+ #define ROAR_WARN(format, ...)
+ #define ROAR_INFO(format, level, ...)
+#elif __GNUC__ < 3
  #define ROAR_DBG(format, args...)
  #define ROAR_ERR(format, args...)
Index: libroar/libroar.c
===================================================================
--- libroar/libroar.c	(revision 4243)
+++ libroar/libroar.c	(revision 4554)
@@ -42,5 +42,5 @@
 #elif defined(ROAR_TARGET_MICROCONTROLLER)
  return 0;
-#else
+#elif defined(_SC_PAGESIZE)
  long sz = sysconf(_SC_PAGESIZE);
  unsigned long int pos = (unsigned long int) addr;
@@ -51,4 +51,6 @@
 
  return mlock((void*)pos, len);
+#else
+ return -1;
 #endif
 }
@@ -63,5 +65,5 @@
 #elif defined(ROAR_TARGET_MICROCONTROLLER)
  return 0;
-#else
+#elif defined(_SC_PAGESIZE)
  long sz = sysconf(_SC_PAGESIZE);
  unsigned long int pos = (unsigned long int) addr;
@@ -72,4 +74,6 @@
 
  return munlock((void*)pos, len);
+#else
+ return -1;
 #endif
 }
Index: libroar/socket.c
===================================================================
--- libroar/socket.c	(revision 4257)
+++ libroar/socket.c	(revision 4554)
@@ -221,5 +221,5 @@
 
 int roar_socket_nonblock(int fh, int state) {
-#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER)
+#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && defined(ROAR_HAVE_FCNTL)
  int flags;
 
@@ -253,5 +253,5 @@
 
 int roar_socket_dup_udp_local_end (int fh) {
-#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER)
+#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && defined(ROAR_HAVE_FCNTL)
  int                  n              = -1;
  int                  flags          = -1;
@@ -300,5 +300,5 @@
 #define _SCMR_CONTROLLEN (sizeof(struct cmsghdr) + sizeof(int))
 int roar_socket_send_fh (int sock, int fh, char * mes, size_t len) {
-#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_OS_SUNOS)
+#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_OS_SUNOS) && !defined(ROAR_TARGET_OPENVMS)
  struct iovec     iov[1];
  struct msghdr    msg;
@@ -341,5 +341,5 @@
 
 int roar_socket_recv_fh (int sock,         char * mes, size_t * len) {
-#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_OS_SUNOS)
+#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_OS_SUNOS) && !defined(ROAR_TARGET_OPENVMS)
  struct iovec     iov[1];
  struct msghdr    msg;
