summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-07 16:47:54 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-07 16:47:54 (GMT)
commit6774f8c6832c3b545d383310317b624a7f4c6787 (patch)
tree91d7e2ac070ae9aa2c2ab93b31966812e204d4bf /include
parent1278186d4fc03d3d7eeae188f2f0f2c38b764390 (diff)
Started to add assertions in functions.
Fixed a bug in tng_implicit_num_particles_set().
Diffstat (limited to 'include')
-rw-r--r--include/tng_io.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tng_io.h b/include/tng_io.h
index d7ebfb1..832379b 100644
--- a/include/tng_io.h
+++ b/include/tng_io.h
@@ -269,6 +269,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#ifdef USE_STD_INTTYPES_H
@@ -342,6 +343,12 @@ typedef unsigned __int64 uint64_t;
/** The maximum allowed length of a string */
#define TNG_MAX_STR_LEN 1024
+#ifndef NDEBUG
+#define TNG_ASSERT(cnd, msg) if(!cnd) {printf("%s\n", msg); assert(cnd);}
+#else
+#define TNG_ASSERT(cnd, msg) ((void) 0)
+#endif
+
/** Flag to specify the endianness of a TNG file */
typedef enum {TNG_BIG_ENDIAN,
TNG_LITTLE_ENDIAN} tng_file_endianness;
contact: Jan Huwald // Impressum