libusbi.h: fix warning about redefined macros
authorNathan Hjelm <hjelmn@me.com>
Tue, 15 Sep 2020 04:06:14 +0000 (22:06 -0600)
committerNathan Hjelm <hjelmn@me.com>
Tue, 15 Sep 2020 04:09:07 +0000 (22:09 -0600)
In macOS 11.x the USEC_PER_SEC and NSEC_PER_SEC are defined by a system
header. The values are the same so use the system defines if they are
available.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/libusbi.h
libusb/version_nano.h

index c4e705f..a3c361b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
  * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
  * Copyright © 2019 Nathan Hjelm <hjelmn@cs.umm.edu>
- * Copyright © 2019 Google LLC. All rights reserved.
+ * Copyright © 2019-2020 Google LLC. All rights reserved.
  * Copyright © 2020 Chris Dickens <christopher.a.dickens@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
@@ -228,8 +228,13 @@ static inline void *usbi_reallocf(void *ptr, size_t size)
        return ret;
 }
 
+#if !defined(USEC_PER_SEC)
 #define USEC_PER_SEC   1000000L
+#endif
+
+#if !defined(NSEC_PER_SEC)
 #define NSEC_PER_SEC   1000000000L
+#endif
 
 #define TIMEVAL_IS_VALID(tv)                                           \
        ((tv)->tv_sec >= 0 &&                                           \
index 4b21d4e..17159e0 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11560
+#define LIBUSB_NANO 11564