libd0_blind_id_la_SOURCES += d0_bignum-gmp.c
endif
endif
-libd0_blind_id_la_LDFLAGS = -versioninfo 5:0:5
+libd0_blind_id_la_LDFLAGS = -versioninfo 6:0:6
libd0_blind_id_la_CFLAGS = -fvisibility=hidden -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement
library_includedir = $(includedir)/d0_blind_id
library_include_HEADERS = d0_blind_id.h d0.h
-AC_INIT([d0_blind_id], [0.3], [divVerent@xonotic.org])
+AC_INIT([d0_blind_id], [0.4], [divVerent@xonotic.org])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_PROG_CC
//#define MUTEX_DEBUG
-void *(*d0_malloc)(size_t len) = malloc;
-void (*d0_free)(void *p) = free;
-
#ifdef MUTEX_DEBUG
#define NUM_MUTEXES 2
#include <stdio.h>
}
#endif
-void *(*d0_createmutex)(void) = dummy_createmutex;
-void (*d0_destroymutex)(void *) = dummy_destroymutex;
-int (*d0_lockmutex)(void *) = dummy_lockmutex;
-int (*d0_unlockmutex)(void *) = dummy_unlockmutex;
+d0_malloc_t *d0_malloc = malloc;
+d0_free_t *d0_free = free;
+d0_createmutex_t *d0_createmutex = dummy_createmutex;
+d0_destroymutex_t *d0_destroymutex = dummy_destroymutex;
+d0_lockmutex_t *d0_lockmutex = dummy_lockmutex;
+d0_unlockmutex_t *d0_unlockmutex = dummy_unlockmutex;
+
+void d0_setmallocfuncs(d0_malloc_t *m, d0_free_t *f)
+{
+ d0_malloc = (m ? m : malloc);
+ d0_free = (f ? f : free);
+}
+
+void d0_setmutexfuncs(d0_createmutex_t *c, d0_destroymutex_t *d, d0_lockmutex_t *l, d0_unlockmutex_t *u)
+{
+ d0_createmutex = (c ? c : dummy_createmutex);
+ d0_destroymutex = (d ? d : dummy_destroymutex);
+ d0_lockmutex = (l ? l : dummy_lockmutex);
+ d0_unlockmutex = (u ? u : dummy_unlockmutex);
+}
#define D0_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#define D0_BOOL int
-extern void *(*d0_malloc)(size_t len);
-extern void (*d0_free)(void *p);
+typedef void *(d0_malloc_t)(size_t len);
+typedef void (d0_free_t)(void *p);
+typedef void *(d0_createmutex_t)(void);
+typedef void (d0_destroymutex_t)(void *);
+typedef int (d0_lockmutex_t)(void *); // zero on success
+typedef int (d0_unlockmutex_t)(void *); // zero on success
-extern void *(*d0_createmutex)(void);
-extern void (*d0_destroymutex)(void *);
-extern int (*d0_lockmutex)(void *); // zero on success
-extern int (*d0_unlockmutex)(void *); // zero on success
+extern d0_malloc_t *d0_malloc;
+extern d0_free_t *d0_free;
+extern d0_createmutex_t *d0_createmutex;
+extern d0_destroymutex_t *d0_destroymutex;
+extern d0_lockmutex_t *d0_lockmutex;
+extern d0_unlockmutex_t *d0_unlockmutex;
+
+D0_EXPORT void d0_setmallocfuncs(d0_malloc_t *m, d0_free_t *f);
+D0_EXPORT void d0_setmutexfuncs(d0_createmutex_t *c, d0_destroymutex_t *d, d0_lockmutex_t *l, d0_unlockmutex_t *u);
extern const char *d0_bsd_license_notice;