File: misc.h

package info (click to toggle)
cliquer 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 484 kB
  • sloc: ansic: 5,394; makefile: 180
file content (77 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download | duplicates (2)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77

#ifndef CLIQUER_MISC_H
#define CLIQUER_MISC_H

#include "cliquerconf.h"

/*
 * We #define boolean instead of using a typedef because nauty.h uses it
 * also.  AFAIK, there is no way to check for an existing typedef, and
 * re-typedefing is illegal (even when using exactly the same datatype!).
 */
#ifndef boolean
#define boolean int
#endif


/*
 * Default value for UNUSED_FUNCTION:  use "__attribute__((unused))" for
 * GCC versions that support it, otherwise leave blank.
 */
#ifndef UNUSED_FUNCTION
# if     __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#  define UNUSED_FUNCTION __attribute__((unused))
# else
#  define UNUSED_FUNCTION
# endif
#endif  /* !UNUSED_FUNCTION */

#ifndef PUBLIC
#  if __GNUC__ >= 4
#    define PUBLIC extern __attribute__ ((visibility("default")))
#  else
#    define PUBLIC extern
#  endif
#endif

/*
 * Default inlining directive:  "inline"
 */
#ifndef INLINE
#define INLINE inline
#endif


#include <stdio.h>
#include <stdlib.h>

#ifndef ASSERT
#define ASSERT(expr) \
        if (!(expr)) { \
		fprintf(stderr,"cliquer file %s: line %d: assertion failed: " \
			"(%s)\n",__FILE__,__LINE__,#expr); \
		abort(); \
	}
#endif /* !ASSERT */


#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif


#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#ifndef ABS
#define ABS(v)  (((v)<0)?(-(v)):(v))
#endif

#endif /* !CLIQUER_MISC_H */