Created
May 6, 2015 13:04
-
-
Save rlonstein/bb24b8d6e668f39ec63c to your computer and use it in GitHub Desktop.
re: brbx/libusb-d#1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/libusb/funcs.d b/src/libusb/funcs.d | |
index 9e8e335..af47f42 100644 | |
--- a/src/libusb/funcs.d | |
+++ b/src/libusb/funcs.d | |
@@ -20,7 +20,16 @@ import consts; | |
import enums; | |
import structs; | |
import core.stdc.limits : INT_MAX; | |
-import core.sys.posix.sys.time : timeval; | |
+ | |
+version( Windows ) { | |
+ import core.sys.windows.winsock2.d : timeval; | |
+} | |
+else version( Posix ) { | |
+ import core.sys.posix.sys.time : timeval; | |
+} | |
+else { | |
+ static assert(false, "Unsupported platform"); | |
+} | |
extern (C): | |
diff --git a/src/libusb/package.d b/src/libusb/package.d | |
index f1afb52..8b59fe8 100644 | |
--- a/src/libusb/package.d | |
+++ b/src/libusb/package.d | |
@@ -41,7 +41,5 @@ public { | |
import funcs; | |
} | |
-import core.sys.posix.sys.time : timeval; | |
- | |
/* Total number of error codes in enum libusb_error */ | |
const LIBUSB_ERROR_COUNT = EnumMembers!libusb_error.length; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment