cvc4-1.4
cvc4_public.h
Go to the documentation of this file.
1/********************* */
19#ifndef __CVC4_PUBLIC_H
20#define __CVC4_PUBLIC_H
21
22#include <stdint.h>
23
24#if defined _WIN32 || defined __CYGWIN__
25# define CVC4_PUBLIC
26#else /* !( defined _WIN32 || defined __CYGWIN__ ) */
27# if __GNUC__ >= 4
28# define CVC4_PUBLIC __attribute__ ((__visibility__("default")))
29# else /* !( __GNUC__ >= 4 ) */
30# define CVC4_PUBLIC
31# endif /* __GNUC__ >= 4 */
32#endif /* defined _WIN32 || defined __CYGWIN__ */
33
34// Can use CVC4_UNDEFINED for things like undefined, private
35// copy constructors. The advantage is that with CVC4_UNDEFINED,
36// if something _does_ try to call the function, you get an error
37// at the point of the call (rather than a link error later).
38
39// CVC4_UNUSED is to mark something (e.g. local variable, function)
40// as being _possibly_ unused, so that the compiler generates no
41// warning about it. This might be the case for e.g. a variable
42// only used in DEBUG builds.
43
44#ifdef __GNUC__
45# if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3 )
46 /* error function attribute only exists in GCC >= 4.3.0 */
47# define CVC4_UNDEFINED __attribute__((__error__("this function intentionally undefined")))
48# else /* GCC < 4.3.0 */
49# define CVC4_UNDEFINED
50# endif /* GCC >= 4.3.0 */
51#else /* ! __GNUC__ */
52# define CVC4_UNDEFINED
53#endif /* __GNUC__ */
54
55#ifdef __GNUC__
56# define CVC4_UNUSED __attribute__((__unused__))
57# define CVC4_NORETURN __attribute__ ((__noreturn__))
58# define CVC4_CONST_FUNCTION __attribute__ ((__const__))
59# define CVC4_PURE_FUNCTION __attribute__ ((__pure__))
60# define CVC4_DEPRECATED __attribute__ ((__deprecated__))
61# define CVC4_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
62#else /* ! __GNUC__ */
63# define CVC4_UNUSED
64# define CVC4_NORETURN
65# define CVC4_CONST_FUNCTION
66# define CVC4_PURE_FUNCTION
67# define CVC4_DEPRECATED
68# define CVC4_WARN_UNUSED_RESULT
69#endif /* __GNUC__ */
70
71#endif /* __CVC4_PUBLIC_H */