File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,17 @@ AC_CHECK_FUNCS([memset])
37
37
# C99
38
38
CFLAGS="$CFLAGS -std=c99"
39
39
40
+ case "${host}" in
41
+ *-cygwin* | *-mingw*)
42
+ os_win32=yes
43
+ ;;
44
+ *)
45
+ os_win32=no
46
+ ;;
47
+ esac
48
+
49
+ AM_CONDITIONAL([ OS_WIN32] , [ test "x$os_win32" = "xyes"] )
50
+
40
51
AC_CONFIG_FILES ( [ Makefile
41
52
src/Makefile] )
42
53
AC_OUTPUT
Original file line number Diff line number Diff line change @@ -8,3 +8,7 @@ mfoc_SOURCES = crapto1.c crypto1.c mfoc.c mifare.c nfc-utils.c
8
8
mfoc_LDADD = @libnfc_LIBS@
9
9
10
10
dist_man_MANS = mfoc.1
11
+
12
+ if OS_WIN32
13
+ AM_CFLAGS += -I@srcdir@/win32
14
+ endif
Original file line number Diff line number Diff line change
1
+ #ifndef _ERR_H_
2
+ #define _ERR_H_
3
+
4
+ #include <stdlib.h>
5
+
6
+ #define warnx (...) do { \
7
+ fprintf (stderr, __VA_ARGS__); \
8
+ fprintf (stderr, "\n"); \
9
+ } while (0)
10
+
11
+ #define errx (code , ...) do { \
12
+ fprintf (stderr, __VA_ARGS__); \
13
+ fprintf (stderr, "\n"); \
14
+ exit (code); \
15
+ } while (0)
16
+
17
+ #define err errx
18
+
19
+ #endif /* !_ERR_H_ */
You can’t perform that action at this time.
0 commit comments