소스 검색

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 년 전
부모
커밋
8e274a111c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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)