Started porting to openbsd, indented some code

This commit is contained in:
adri 2022-06-24 14:24:03 +02:00
parent 3ce863a90a
commit efa5970da0
2 changed files with 49 additions and 35 deletions

View file

@ -28,6 +28,13 @@ else ifeq ($(PLATFORM), FreeBSD)
LIBDIR = lib LIBDIR = lib
ETC_DIR = /etc ETC_DIR = /etc
MANDIR = share/man/man1 MANDIR = share/man/man1
else ifeq ($(PLATFORM), BSD)
CFLAGS += -D__OPENBSD__
CFLAGS_DEBUG += -D__OPENBSD__
PREFIX = bin
LIBDIR = lib
ETC_DIR = /etc
MANDIR = share/man/man1
else ifeq ($(PLATFORM), windows32) else ifeq ($(PLATFORM), windows32)
CC = gcc CC = gcc
PREFIX = "C:\Program Files" PREFIX = "C:\Program Files"

View file

@ -30,12 +30,19 @@
#include <unistd.h> #include <unistd.h>
#if defined(__APPLE__) || defined(__FREEBSD__) #if defined(__APPLE__) || defined(__FREEBSD__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#if defined(__OPENBSD__)
#include <sys/time.h>
#else
#include <time.h> #include <time.h>
#endif // defined(__OPENBSD__)
#else // defined(__APPLE__) || defined(__FREEBSD__) #else // defined(__APPLE__) || defined(__FREEBSD__)
#ifdef __FREEBSD__ #ifdef __FREEBSD__
#else // defined(__FREEBSD__) || defined(_WIN32) #else // defined(__FREEBSD__) || defined(_WIN32)
#ifndef _WIN32 #ifndef _WIN32
#ifndef __OPENBSD__
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#else // __OPENBSD__
#endif // __OPENBSD__
#else // _WIN32 #else // _WIN32
#include <sysinfoapi.h> #include <sysinfoapi.h>
#endif // _WIN32 #endif // _WIN32