]> git.rm.cloudns.org Git - xonotic/d0_blind_id.git/commitdiff
work around missing BN_*_negative on Crap OS X
authorRudolf Polzer <divverent@alientrap.org>
Tue, 7 Sep 2010 17:47:41 +0000 (19:47 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 7 Sep 2010 17:47:41 +0000 (19:47 +0200)
d0_bignum-openssl.c

index b4fc8732718c194d3b2aeec76c271642139749c7..ef7985a72000f1dd946b5206126e6fb474c62095 100644 (file)
 #include <string.h>
 #include <openssl/bn.h>
 
+// for stupid OpenSSL versions in Mac OS X
+#ifndef BN_is_negative
+#define BN_is_negative(a) ((a)->neg != 0)
+#endif
+#ifndef BN_set_negative
+#define BN_set_negative(a,n) ((a)->neg = ((n) && !BN_is_zero(b)))
+#endif
+
 struct d0_bignum_s
 {
        BIGNUM z;