github.com/jurelou/go-magic@v0.0.0-20230518182705-f2995a311800/common.h (about) 1 #if !defined(_COMMON_H) 2 #define _COMMON_H 1 3 4 #if !defined(_GNU_SOURCE) 5 # define _GNU_SOURCE 1 6 #endif 7 8 #if !defined(_DEFAULT_SOURCE) 9 # define _DEFAULT_SOURCE 1 10 #endif 11 12 #if defined(__cplusplus) 13 extern "C" { 14 #endif 15 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <limits.h> 19 #include <string.h> 20 #include <unistd.h> 21 #include <fcntl.h> 22 #include <errno.h> 23 #include <assert.h> 24 #include <sys/stat.h> 25 #include <magic.h> 26 27 #if !defined(UNUSED) 28 # define UNUSED(x) (void)(x) 29 #endif 30 31 #if defined(F_DUPFD_CLOEXEC) 32 # define HAVE_F_DUPFD_CLOEXEC 1 33 #endif 34 35 #if defined(O_CLOEXEC) 36 # define HAVE_O_CLOEXEC 1 37 #endif 38 39 #if defined(POSIX_CLOSE_RESTART) 40 # define HAVE_POSIX_CLOSE_RESTART 1 41 #endif 42 43 #if !defined(MAGIC_NO_CHECK_CSV) 44 # define MAGIC_NO_CHECK_CSV 0 45 #endif 46 47 #if !defined(MAGIC_NO_CHECK_JSON) 48 # define MAGIC_NO_CHECK_JSON 0 49 #endif 50 51 #if defined(MAGIC_VERSION) && MAGIC_VERSION >= 532 52 # define HAVE_MAGIC_GETFLAGS 1 53 #endif 54 55 #if defined(__cplusplus) 56 } 57 #endif 58 59 #endif /* _COMMON_H */