]> prime8.dev >> repos - ttyd.git/commitdiff
Shims to compile under OpenBSD
authordohnuts <dohnuts@users.noreply.github.com>
Fri, 3 Mar 2017 18:36:34 +0000 (13:36 -0500)
committerShuanglei Tao <tsl0922@gmail.com>
Thu, 9 Mar 2017 14:18:02 +0000 (22:18 +0800)
STAILQ_HEAD is implemented as SIMPLEQ_HEAD
pty.h is like in apple , util.h

src/server.h

index 257ca2f6e61ea69b1777104fef4e092adbc9de76..d547647be37275c5f5f8407967b908fd4ed84a5e 100644 (file)
 #include <sys/wait.h>
 #include <assert.h>
 
-#ifdef __APPLE__
+#ifdef __OpenBSD__
+#define STAILQ_HEAD            SIMPLEQ_HEAD
+#define STAILQ_ENTRY           SIMPLEQ_ENTRY
+#define STAILQ_INIT            SIMPLEQ_INIT
+#define STAILQ_INSERT_TAIL     SIMPLEQ_INSERT_TAIL
+#define STAILQ_EMPTY           SIMPLEQ_EMPTY
+#define STAILQ_FIRST           SIMPLEQ_FIRST
+#define STAILQ_REMOVE_HEAD     SIMPLEQ_REMOVE_HEAD
+#define STAILQ_FOREACH         SIMPLEQ_FOREACH
+#endif
+
+#if defined(__OpenBSD__) || defined(__APPLE__)
 #include <util.h>
 #elif defined(__FreeBSD__)
 #include <libutil.h>