blob: 890e3fbdbb544596ca5384553dfc365e98bdb5c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
void (*nissy_log)(const char *, va_list);
void
_log(const char *str, ...) /* TODO: rename */
{
va_list args;
if (nissy_log != NULL) {
va_start(args, str);
nissy_log(str, args);
va_end(args);
}
}
#ifdef DEBUG
#define _static
#define _static_inline
#define DBG_WARN(condition, ...) if (!(condition)) _log(__VA_ARGS__);
#define DBG_ASSERT(condition, retval, ...) \
if (!(condition)) { _log(__VA_ARGS__); return retval; }
#else
#define _static static
#define _static_inline static inline
#define DBG_WARN(condition, ...)
#define DBG_ASSERT(condition, retval, ...)
#endif
#include "constants.h"
#if defined(CUBE_AVX2)
#include <immintrin.h>
#include "cube_avx2.h"
#elif defined(CUBE_NEON)
#include "cube_neon.h"
#else
#include <stdlib.h> /* TODO: check if can be removed */
#include "cube_portable.h"
#endif
#include "io_move_trans.h"
#include "constant_cubes.h"
#include "cube_generic.h"
#include "io_cube.h"
/* TODO: work in progress */
#if 0
#include "constant_cubes_transform.h"
#include "cube_transform.h"
#else
#include "cube_transform_with_switch.h"
#endif
#include "moves.h"
#include "solve_h48.h"
#include "solve_generic.h"
#include "cube_public.h"
|