diff options
author | Vadim Mikhailov <mvp@users.noreply.github.com> | 2017-07-28 11:41:57 -0700 |
---|---|---|
committer | Vadim Mikhailov <mvp@users.noreply.github.com> | 2017-07-28 11:41:57 -0700 |
commit | 1a61130635c6cfd943526cfd9980f1267717d50f (patch) | |
tree | c3663f2f1984236af39d17757f3d0b9de816b02e | |
parent | 15321d392afac37768ceb8015037e8d1005df03d (diff) |
fixed all pedantic warnings
Tested by compiling on Linux and Mac.
-rw-r--r-- | uhubctl.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -10,16 +10,24 @@ */ #define PROGRAM_VERSION "1.7" +#define _XOPEN_SOURCE 500 #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <strings.h> #include <getopt.h> #include <errno.h> #include <ctype.h> + #if defined(_WIN32) +#include <windows.h> #include <io.h> #include <process.h> +#define strcasecmp _stricmp +#define strncasecmp _strnicmp +#else +#include <unistd.h> #endif #if defined(__FreeBSD__) || defined(_WIN32) @@ -28,14 +36,8 @@ #include <libusb-1.0/libusb.h> #endif -#if defined(_WIN32) -#include <windows.h> -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#elif _POSIX_C_SOURCE >= 199309L +#if _POSIX_C_SOURCE >= 199309L #include <time.h> /* for nanosleep */ -#else -#include <unistd.h> /* for usleep */ #endif /* cross-platform sleep function */ |