Prechádzať zdrojové kódy

Add ARRAY_SIZE definition check

This is often defined in various places, add a definition check to make
sure it is not already defined.
Tomasz Gorochowik 6 rokov pred
rodič
commit
8e274a111c
1 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -439,7 +439,9 @@ _civet_safe_clock_gettime(int clk_id, struct timespec *t)
 /********************************************************************/
 
 /* Helper makros */
+#if !defined(ARRAY_SIZE)
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
+#endif
 
 /* Standard defines */
 #if !defined(INT64_MAX)