Tue, 07 Feb 2023 20:08:45 +0100
fix code not compiling under windows+mingw
src/allocator.c | file | annotate | diff | comparison | revisions | |
src/array_list.c | file | annotate | diff | comparison | revisions | |
src/basic_mempool.c | file | annotate | diff | comparison | revisions | |
src/buffer.c | file | annotate | diff | comparison | revisions | |
src/compare.c | file | annotate | diff | comparison | revisions | |
src/cx/common.h | file | annotate | diff | comparison | revisions | |
src/cx/compare.h | file | annotate | diff | comparison | revisions | |
src/linked_list.c | file | annotate | diff | comparison | revisions | |
test/test_compare.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/allocator.c Tue Feb 07 20:08:08 2023 +0100 1.2 +++ b/src/allocator.c Tue Feb 07 20:08:45 2023 +0100 1.3 @@ -28,8 +28,6 @@ 1.4 1.5 #include "cx/allocator.h" 1.6 1.7 -#include <stdlib.h> 1.8 - 1.9 __attribute__((__malloc__, __alloc_size__(2))) 1.10 static void *cx_malloc_stdlib( 1.11 __attribute__((__unused__)) void *d,
2.1 --- a/src/array_list.c Tue Feb 07 20:08:08 2023 +0100 2.2 +++ b/src/array_list.c Tue Feb 07 20:08:45 2023 +0100 2.3 @@ -29,7 +29,6 @@ 2.4 #include "cx/array_list.h" 2.5 #include <assert.h> 2.6 #include <string.h> 2.7 -#include <stdint.h> 2.8 2.9 // LOW LEVEL ARRAY LIST FUNCTIONS 2.10
3.1 --- a/src/basic_mempool.c Tue Feb 07 20:08:08 2023 +0100 3.2 +++ b/src/basic_mempool.c Tue Feb 07 20:08:45 2023 +0100 3.3 @@ -28,7 +28,6 @@ 3.4 3.5 #include "cx/basic_mempool.h" 3.6 #include "cx/utils.h" 3.7 -#include <stdint.h> 3.8 #include <string.h> 3.9 3.10 #define of_chk_(n) if (SIZE_MAX - sizeof(cx_destructor_func) < (n)) return NULL
4.1 --- a/src/buffer.c Tue Feb 07 20:08:08 2023 +0100 4.2 +++ b/src/buffer.c Tue Feb 07 20:08:45 2023 +0100 4.3 @@ -29,10 +29,8 @@ 4.4 #include "cx/buffer.h" 4.5 #include "cx/utils.h" 4.6 4.7 -#include <stdlib.h> 4.8 #include <stdio.h> 4.9 #include <string.h> 4.10 -#include <stdint.h> 4.11 4.12 int cxBufferInit( 4.13 CxBuffer *buffer,
5.1 --- a/src/compare.c Tue Feb 07 20:08:08 2023 +0100 5.2 +++ b/src/compare.c Tue Feb 07 20:08:45 2023 +0100 5.3 @@ -28,7 +28,6 @@ 5.4 5.5 #include "cx/compare.h" 5.6 5.7 -#include <stdint.h> 5.8 #include <math.h> 5.9 5.10 int cx_cmp_int(void const *i1, void const *i2) {
6.1 --- a/src/cx/common.h Tue Feb 07 20:08:08 2023 +0100 6.2 +++ b/src/cx/common.h Tue Feb 07 20:08:45 2023 +0100 6.3 @@ -92,6 +92,7 @@ 6.4 #include <stdlib.h> 6.5 #include <stddef.h> 6.6 #include <stdbool.h> 6.7 +#include <stdint.h> 6.8 6.9 /** 6.10 * Function pointer compatible with fwrite-like functions. 6.11 @@ -104,12 +105,15 @@ 6.12 ); 6.13 6.14 #ifdef _WIN32 6.15 +#ifdef __MINGW32__ 6.16 +#include <sys/types.h> 6.17 +#endif // __MINGW32__ 6.18 #ifndef __WORDSIZE 6.19 #ifdef _WIN64 6.20 #define __WORDSIZE 64 6.21 #else 6.22 #define __WORDSIZE 32 6.23 -#endif 6.24 +#endif // _WIN64 6.25 #endif // __WORDSIZE 6.26 #else // !_WIN32 6.27
7.1 --- a/src/cx/compare.h Tue Feb 07 20:08:08 2023 +0100 7.2 +++ b/src/cx/compare.h Tue Feb 07 20:08:45 2023 +0100 7.3 @@ -37,6 +37,8 @@ 7.4 #ifndef UCX_COMPARE_H 7.5 #define UCX_COMPARE_H 7.6 7.7 +#include "common.h" 7.8 + 7.9 #ifdef __cplusplus 7.10 extern "C" { 7.11 #endif
8.1 --- a/src/linked_list.c Tue Feb 07 20:08:08 2023 +0100 8.2 +++ b/src/linked_list.c Tue Feb 07 20:08:45 2023 +0100 8.3 @@ -28,7 +28,6 @@ 8.4 8.5 #include "cx/linked_list.h" 8.6 #include "cx/utils.h" 8.7 -#include <stdint.h> 8.8 #include <string.h> 8.9 #include <assert.h> 8.10
9.1 --- a/test/test_compare.cpp Tue Feb 07 20:08:08 2023 +0100 9.2 +++ b/test/test_compare.cpp Tue Feb 07 20:08:45 2023 +0100 9.3 @@ -87,7 +87,7 @@ 9.4 } 9.5 9.6 TEST(Compare, Uint) { 9.7 - test_compare<uint>(cx_cmp_uint); 9.8 + test_compare<unsigned int>(cx_cmp_uint); 9.9 } 9.10 9.11 TEST(Compare, Ulongint) {