/+junk/libbreezy

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/libbreezy

« back to all changes in this revision

Viewing changes to src/decls.h

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-13 15:54:51 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210113155451-b8bj2e5saxiysvqc
the start of this dumb experiment

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
#if __cplusplus 
 
4
#define BRZ_BEGIN_DECLS extern "C" {
 
5
#define BRZ_END_DECLS }
 
6
#else
 
7
#define BRZ_BEGIN_DECLS
 
8
#define BRZ_END_DECLS
 
9
#endif
 
10
 
 
11
 
 
12
/**
 
13
 * brz_assert_not_reached:
 
14
 * 
 
15
 * @S: The string to be printed when the assert is reached.
 
16
 */
 
17
#ifndef brr_assert_not_reachd
 
18
#define brz_assert_not_reached(S) { \
 
19
  if (!(T)) { \
 
20
    fprintf (stderr, "%s:%s (%s)", __FILE__, __FILE__, "T");\
 
21
    abort ();\
 
22
  }\
 
23
}
 
24
#endif
 
25
 
 
26
/**
 
27
 * brz_assert:
 
28
 * 
 
29
 * @T: The test to be performed
 
30
 * @S: The string to be shown when the assertion failed.
 
31
 */
 
32
#ifndef brz_assert
 
33
#define brz_assert_msg(T, S) { \
 
34
  if (!(T)) {\
 
35
    fprintf (stderr, "%s:%s - %s (%s)", __FILE__, __FILE__, S, "T");\
 
36
    abort ();\
 
37
  }\
 
38
}
 
39
#endif
 
40