Signed-off-by: Paul Brossier <piem@piem.org>
# build libaubio.so (cshlib) and/or libaubio.a (cstlib)
if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
build_features = ['cstlib']
# build libaubio.so (cshlib) and/or libaubio.a (cstlib)
if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
build_features = ['cstlib']
+elif ctx.env['DEST_OS'] in ['win32', 'win64']:
+ build_features = ['cshlib']
else: #linux, darwin, android, mingw, ...
build_features = ['cshlib', 'cstlib']
else: #linux, darwin, android, mingw, ...
build_features = ['cshlib', 'cstlib']
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#define PRINT_ERR(format, args...) fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
#define PRINT_MSG(format, args...) fprintf(stdout, format , ##args)
#define PRINT_DBG(format, args...) fprintf(stderr, format , ##args)
#define PRINT_WRN(format, args...) fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
#define PRINT_ERR(format, args...) fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
#define PRINT_MSG(format, args...) fprintf(stdout, format , ##args)
#define PRINT_DBG(format, args...) fprintf(stderr, format , ##args)
#define PRINT_WRN(format, args...) fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
+#ifdef HAVE_WIN_HACKS
+// http://en.wikipedia.org/wiki/Linear_congruential_generator
+// no srandom/random on win32
+
+uint_t srandom_seed = 1029;
+
+void srandom(uint_t new_seed) {
+ srandom_seed = new_seed;
+}
+
+uint_t random(void) {
+ srandom_seed = 1664525 * srandom_seed + 1013904223;
+ return srandom_seed;
+}
+#endif
+
void utils_init_random () {
time_t now = time(0);
struct tm *tm_struct = localtime(&now);
void utils_init_random () {
time_t now = time(0);
struct tm *tm_struct = localtime(&now);
ctx.load('compiler_c')
ctx.load('waf_unit_test')
ctx.load('gnu_dirs')
ctx.load('compiler_c')
ctx.load('waf_unit_test')
ctx.load('gnu_dirs')
- ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra', '-fPIC']
+
+ ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
target_platform = Options.platform
if ctx.options.target_platform:
target_platform = ctx.options.target_platform
ctx.env['DEST_OS'] = target_platform
target_platform = Options.platform
if ctx.options.target_platform:
target_platform = ctx.options.target_platform
ctx.env['DEST_OS'] = target_platform
- if target_platform == 'win32':
- ctx.env['shlib_PATTERN'] = 'lib%s.dll'
+ if target_platform not in ['win32', 'win64']:
+ ctx.env.CFLAGS += ['-fPIC']
+ else:
+ ctx.define('HAVE_WIN_HACKS', 1)
+ ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
if target_platform == 'darwin':
ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
if target_platform == 'darwin':
ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']