Created
October 27, 2011 21:30
-
-
Save qbit/1320940 to your computer and use it in GitHub Desktop.
Working patch for despotify on openbsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/lib/auth.c | |
=================================================================== | |
--- src/lib/auth.c (revision 516) | |
+++ src/lib/auth.c (working copy) | |
@@ -22,6 +22,8 @@ | |
#include "sha1.h" | |
#include "hmac.h" | |
+#define DEBUG_LOGIN | |
+ | |
void auth_generate_auth_hash (SESSION * session) | |
{ | |
SHA1_CTX ctx; | |
Index: src/lib/puzzle.c | |
=================================================================== | |
--- src/lib/puzzle.c (revision 516) | |
+++ src/lib/puzzle.c (working copy) | |
@@ -14,11 +14,12 @@ | |
#include "util.h" | |
#include "sha1.h" | |
- | |
+#ifndef __use_openbsd__ | |
#if !defined srandom || !defined random | |
#define srandom srand | |
#define random rand | |
#endif | |
+#endif | |
void puzzle_solve (SESSION * session) | |
{ | |
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