$OpenBSD: patch-src_c_wrapper_c,v 1.3 2020/11/04 20:45:00 solene Exp $

add OpenBSD support

--- src/c/wrapper.c.orig	Thu Mar  5 09:25:57 2020
+++ src/c/wrapper.c	Fri Jul 31 18:32:51 2020
@@ -104,7 +104,7 @@
   #include <sys/errno.h>
   #include <sys/fcntl.h>
  #elif defined(AIX) || defined(HPUX) || defined(MACOSX)
- #elif defined(FREEBSD)
+ #elif defined(FREEBSD) || defined(OPENBSD)
   #include <sys/param.h>
   #include <errno.h>
  #else /* LINUX */
@@ -5784,7 +5784,7 @@ int wrapperRunCommonInner() {
         tz1 = tzname[0];
         tz2 = tzname[1];
 #endif
-#ifndef FREEBSD
+#if !defined(FREEBSD) && !defined(OPENBSD)
                 log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Timezone:     %s (%s) Offset: %ld, hasDaylight: %d"),
                         tz1, tz2, timezone, daylight);
 #else
@@ -6454,7 +6454,7 @@ int checkIfBinary(const TCHAR *filename) {
             log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Magic number for file %s: 0x%02x%02x%02x%02x"), filename, head[0], head[1], head[2], head[3]);
         }
 
-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) 
+#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(OPENBSD)
         if (head[1] == 'E' && head[2] == 'L' && head[3] == 'F') {
             return 1; /*ELF */
 #elif defined(AIX)
@@ -7882,7 +7882,7 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings,
 
     /* See if the auto bits parameter is set.  Ignored by all but the following platforms. */
 
-#if /*defined(WIN32) || defined(LINUX) ||*/ defined(HPUX) || defined(MACOSX) || defined(SOLARIS) || defined(FREEBSD)
+#if /*defined(WIN32) || defined(LINUX) ||*/ defined(HPUX) || defined(MACOSX) || defined(SOLARIS) || defined(FREEBSD) || defined(OPENBSD)
 
     if (wrapperData->javaVersion->major < 9) {
         if (getBooleanProperty(properties,
@@ -7897,6 +7897,8 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings,
                               TEXT("wrapper.java.additional.auto_bits.solaris"),
 #elif defined(FREEBSD)
                               TEXT("wrapper.java.additional.auto_bits.freebsd"),
+#elif defined(OPENBSD)
+                              TEXT("wrapper.java.additional.auto_bits.openbsd"),
 #elif defined(MACOSX)
                               TEXT("wrapper.java.additional.auto_bits.macosx"),
 #endif
