aboutsummaryrefslogtreecommitdiff
path: root/util.h
blob: 414a9ea8de98a58bee4ebe07dc3721c104c64a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// synacor challenge ([email protected])
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned char u8;
typedef unsigned short u16;
typedef int (*instruction_ptr)(u8 *buffer);

#ifdef NDEBUG
#define LOG(fmt, ...) ((void)0)
#define REG(x) ((void)0)
#else
#define LOG(...) fprintf(stdout, __VA_ARGS__)
#define REG(x) reg_string(x)
char *reg_string(unsigned short r);
#endif