summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-10-24 02:44:35 +0000
committerMorgan Deters <mdeters@gmail.com>2010-10-24 02:44:35 +0000
commitd8a8f335f4043a0117f2b92af3d1e94f285e4d30 (patch)
tree93b52c3f70c6ccd0614aa00ae09054ae6ca625a9 /src/include
parent237995ce0e7f47b826e26c0afb317cf5e3174879 (diff)
add a CVC4_UNDEFINED keyword, for intentionally undefined functions (like private copy constructors and assignment, for instance) that generates better, compile-time error messages if the function is used (before, you'd have to wait until link time); also some minor cleanup
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cvc4_public.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/cvc4_public.h b/src/include/cvc4_public.h
index 714c32e29..f2dbd3bce 100644
--- a/src/include/cvc4_public.h
+++ b/src/include/cvc4_public.h
@@ -45,6 +45,16 @@
# endif /* __GNUC__ >= 4 */
#endif /* defined _WIN32 || defined __CYGWIN__ */
+// Can use CVC4_UNDEFINED for things like undefined, private
+// copy constructors. The advantage is that with CVC4_UNDEFINED,
+// if something _does_ try to call the function, you get an error
+// at the point of the call (rather than a link error later).
+#ifdef __GNUC__
+# define CVC4_UNDEFINED __attribute__((error("this function intentionally undefined")))
+#else /* ! __GNUC__ */
+# define CVC4_UNDEFINED
+#endif /* __GNUC__ */
+
#define EXPECT_TRUE(x) __builtin_expect( (x), true )
#define EXPECT_FALSE(x) __builtin_expect( (x), false )
#define NORETURN __attribute__ ((noreturn))
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback