summaryrefslogtreecommitdiffstats
path: root/Vector.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-17 22:27:33 +0200
committercgzones <cgzones@googlemail.com>2020-10-03 19:04:27 +0200
commitd69585b82abfdaede9e8c358982a4953c432e8d2 (patch)
tree7b087349e21cd51dab789bc44da73272d336937c /Vector.h
parentb7f63292e5394ca7eee2dc5d14d0d1244db61c17 (diff)
Resolve DEBUG compilation issues
Use NDEBUG conditional instead of DEBUG. Do not call static functions in extern inline ones. Vector.c:67:11: error: static function 'Vector_isConsistent' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
Diffstat (limited to 'Vector.h')
-rw-r--r--Vector.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/Vector.h b/Vector.h
index 209e27cf..9bf73b52 100644
--- a/Vector.h
+++ b/Vector.h
@@ -28,12 +28,6 @@ Vector* Vector_new(ObjectClass* type, bool owner, int size);
void Vector_delete(Vector* this);
-#ifdef DEBUG
-
-int Vector_count(Vector* this);
-
-#endif
-
void Vector_prune(Vector* this);
void Vector_quickSort(Vector* this);
@@ -52,25 +46,18 @@ void Vector_moveDown(Vector* this, int idx);
void Vector_set(Vector* this, int idx, void* data_);
-#ifdef DEBUG
+#ifndef NDEBUG
Object* Vector_get(Vector* this, int idx);
-
-#else
-
-#define Vector_get(v_, idx_) ((v_)->array[idx_])
-
-#endif
-
-#ifdef DEBUG
-
int Vector_size(Vector* this);
+int Vector_count(Vector* this);
-#else
+#else /* NDEBUG */
+#define Vector_get(v_, idx_) ((v_)->array[idx_])
#define Vector_size(v_) ((v_)->items)
-#endif
+#endif /* NDEBUG */
void Vector_add(Vector* this, void* data_);

© 2014-2024 Faster IT GmbH | imprint | privacy policy