[PATCH] fix mingw-win32 specific warnings in libdivecomputer.c
Lubomir I. Ivanov
neolit123 at gmail.com
Sun Nov 27 07:44:56 PST 2011
From: "Lubomir I. Ivanov" <neolit123 at gmail.com>
1) since %lld is not defined in the MSVC runtime, use
the portable PRId64 macro from inttypes.h for 64bit integers
notice in inttypes.h from mingw-win32:
/* 7.8.1 Macros for format specifiers
*
* MS runtime does not yet understand C9x standard "ll"
* length specifier. It appears to treat "ll" as "l".
* The non-standard I64 length specifier causes warning in GCC,
* but understood by MS runtime functions.
*/
2) include unistd.h to disable warning:
warning: implicit declaration of function 'usleep'
Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
libdivecomputer.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libdivecomputer.c b/libdivecomputer.c
index b1c86c5..bd960bd 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -1,4 +1,6 @@
#include <stdio.h>
+#include <inttypes.h>
+#include <unistd.h>
#include <pthread.h>
#include "dive.h"
@@ -433,7 +435,7 @@ static void event_cb(device_t *device, device_event_t event, const void *data, v
break;
case DEVICE_EVENT_CLOCK:
devdata->clock = *clock;
- printf("Event: systime=%lld, devtime=%u\n",
+ printf("Event: systime=%"PRId64", devtime=%u\n",
clock->systime, clock->devtime);
break;
default:
--
1.7.6.msysgit.0
More information about the subsurface
mailing list