summaryrefslogtreecommitdiff
path: root/src/dos_cpt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dos_cpt.h')
-rw-r--r--src/dos_cpt.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/dos_cpt.h b/src/dos_cpt.h
index 8cbfb80..a8adfbc 100644
--- a/src/dos_cpt.h
+++ b/src/dos_cpt.h
@@ -20,7 +20,10 @@
/* Kevin Towers can be reached by email: ktowers@omnexcontrols.com */
/* Ken Huntington can be reached by email: kenh@compmore.net */
-#ifdef LINUX
+#ifndef _DOS_CPT_H
+#define _DOS_CPT_H
+
+#if defined (__linux__)
#include <sys/io.h>
#include <unistd.h>
@@ -30,9 +33,20 @@
#define delay(a) usleep(a*1000)
-#else
+#define strlcpy(d, s, l) (strncpy(d, s, l), (d)[(l) - 1] = '\0')
+#define strlcat(d, s, l) strncat(d, s, (l) - strlen(d) - 1)
+
+#elif defined(__OpenBSD__)
+
+#include <machine/pio.h>
+#include <unistd.h>
+
+#define inportb(port) inb(port)
+#define outportb(port, data) outb(port, data)
-#ifdef WIN32
+#define delay(t) usleep((t) * 1000)
+
+#elif defined(__WIN32__)
// these functions are in winnt.c
void win_giveio(void);
@@ -44,10 +58,6 @@ inline void outportb (unsigned short port, const unsigned char val);
#include <dos.h>
-#endif // WIN32
-#endif // LINUX
-
-
-
-
+#endif
+#endif /* not _DOS_CPT_H */