]> git.droids-corp.org - protos/libecoli.git/commitdiff
move ec_count_of in utils.h
authorOlivier Matz <zer0@droids-corp.org>
Sun, 23 Feb 2020 22:37:07 +0000 (23:37 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 23 Feb 2020 22:37:07 +0000 (23:37 +0100)
include/ecoli_config.h
include/ecoli_strvec.h
include/ecoli_utils.h

index ba933378af7c8ce9ff3dbac9e3cfc6c17be3a99b..8ae15ed893de0d2558b56efe9424b9558e82b72a 100644 (file)
 #include <stdint.h>
 #include <stdio.h>
 
-#ifndef EC_COUNT_OF //XXX
-#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
-               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
-#endif
-
 struct ec_config;
 struct ec_dict;
 
index 2464a2bb2ce658fa947c3d4a68bfaa6caa3076a6..ee793e777a015a2fa92a11c6be2e80814dbf147c 100644 (file)
  */
 struct ec_strvec *ec_strvec(void);
 
-#ifndef EC_COUNT_OF
-#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
-               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
-#endif
-
 /**
  * Allocate a new string vector
  *
index 7b76c1788af22a41ef2989748e3d2c4f2569a2c8..7d6afcbad77fa76984c68c0691fa42d858353441 100644 (file)
  */
 #define EC_VA_END ((void *)1)
 
+/**
+ * Count number of elements in an array.
+ */
+#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
+               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
+
 #endif
 
 /** @} */