Skip to content

Instantly share code, notes, and snippets.

@qbit
Created October 25, 2011 00:01
Show Gist options
  • Save qbit/1310855 to your computer and use it in GitHub Desktop.
Save qbit/1310855 to your computer and use it in GitHub Desktop.
despotify patch for openbsd
Index: src/lib/dns.c
===================================================================
--- src/lib/dns.c (revision 516)
+++ src/lib/dns.c (working copy)
@@ -12,7 +12,14 @@
#include <windns.h>
#elif defined __use_posix__
#include <arpa/nameser.h>
+#ifdef __use_openbsd__
+#define ns_c_in C_IN
+#define ns_t_srv T_SRV
+#define NS_HFIXEDSZ HFIXEDSZ
+#define NS_QFIXEDSZ QFIXEDSZ
+#else
#include <arpa/nameser_compat.h>
+#endif
#include <resolv.h>
#endif
Index: src/lib/network.h
===================================================================
--- src/lib/network.h (revision 516)
+++ src/lib/network.h (working copy)
@@ -14,6 +14,10 @@
#define __use_posix__
#endif
+#ifdef __OpenBSD__
+#define __use_openbsd__
+#endif
+
// include stuff
#ifdef __use_winsock__
#include <stdio.h>
Index: src/Makefile
===================================================================
--- src/Makefile (revision 516)
+++ src/Makefile (working copy)
@@ -33,6 +33,12 @@
LT = libtool $(SILENTLIB) --tag=CC
endif
+# OpenBSD specifics
+ifeq ($(shell uname -s),OpenBSD)
+ CFLAGS += -I/usr/local/include
+ LDFLAGS += -L/usr/local/lib -lvorbisfile -logg -lvorbis -lcrypto -lm -lpthread
+endif
+
# windows specifics
ifeq ($(firstword $(subst _, ,$(shell uname -s))), MINGW32)
LDFLAGS += -leay32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment