diff --git a/.patch/libusb/0001-netbsd-gettime.patch b/.patch/libusb/0001-netbsd-gettime.patch new file mode 100644 index 0000000000..8cfab9ea91 --- /dev/null +++ b/.patch/libusb/0001-netbsd-gettime.patch @@ -0,0 +1,25 @@ +diff --git a/libusb/os/netbsd_usb.c b/libusb/os/netbsd_usb.c +index a9a50b2..56e681b 100644 +--- a/libusb/os/netbsd_usb.c ++++ b/libusb/os/netbsd_usb.c +@@ -580,6 +580,20 @@ _access_endpoint(struct libusb_transfer *transfer) + return hpriv->endpoints[endpt]; + } + ++void usbi_get_monotonic_time(struct timespec *tp) { ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ tp->tv_sec = tv.tv_sec; ++ tp->tv_nsec = tv.tv_usec * 1000ull; ++} ++ ++void usbi_get_real_time(struct timespec *tp) { ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ tp->tv_sec = tv.tv_sec; ++ tp->tv_nsec = tv.tv_usec * 1000ull; ++} ++ + int + _sync_gen_transfer(struct usbi_transfer *itransfer) + { diff --git a/docs/Deps.md b/docs/Deps.md index 6777e3af9f..3096a5903b 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -159,7 +159,7 @@ ip6addrctl=YES ip6addrctl_policy=ipv4_prefer ``` -For NetBSD +10.1: `pkgin install git cmake boost fmtlib SDL2 catch2 libjwt spirv-headers ffmpeg7 libva nlohmann-json jq libopus qt6 mbedtls3 cpp-httplib lz4 vulkan-headers nasm autoconf enet pkg-config`. +For NetBSD +10.1: `pkgin install git cmake boost fmtlib SDL2 catch2 libjwt spirv-headers ffmpeg7 libva nlohmann-json jq libopus qt6 mbedtls3 cpp-httplib lz4 vulkan-headers nasm autoconf enet pkg-config libusb1`. glslang is not available on NetBSD, to circumvent this simply build glslang by yourself: ```sh diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json index dc69841ab7..4abe225ab3 100644 --- a/externals/libusb/cpmfile.json +++ b/externals/libusb/cpmfile.json @@ -4,6 +4,9 @@ "tag": "v%VERSION%", "hash": "98c5f7940ff06b25c9aa65aa98e23de4c79a4c1067595f4c73cc145af23a1c286639e1ba11185cd91bab702081f307b973f08a4c9746576dc8d01b3620a3aeb5", "find_args": "MODULE", - "git_version": "1.0.29" + "git_version": "1.0.29", + "patches": [ + "0001-netbsd-gettime.patch" + ] } } diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index ccf6f1cfb2..111988a0f8 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -21,8 +21,8 @@ template struct EnumMetadata { static std::vector> Canonicalizations(); static u32 Index(); - static constexpr T GetFirst(); - static constexpr T GetLast(); + static T GetFirst(); + static T GetLast(); }; #define PAIR_45(N, X, ...) {#X, N::X} __VA_OPT__(, PAIR_46(N, __VA_ARGS__)) @@ -82,10 +82,10 @@ struct EnumMetadata { template<> inline u32 EnumMetadata::Index() { \ return __COUNTER__; \ } \ - template<> inline constexpr NAME EnumMetadata::GetFirst() { \ + template<> inline NAME EnumMetadata::GetFirst() { \ return NAME::PP_HEAD(__VA_ARGS__); \ } \ - template<> inline constexpr NAME EnumMetadata::GetLast() { \ + template<> inline NAME EnumMetadata::GetLast() { \ return (std::vector>{PAIR(NAME, __VA_ARGS__)}).back().second; \ } @@ -106,17 +106,17 @@ inline u32 EnumMetadata::Index() { return 100; } template<> -inline constexpr AudioEngine EnumMetadata::GetFirst() { +inline AudioEngine EnumMetadata::GetFirst() { return AudioEngine::Auto; } template<> -inline constexpr AudioEngine EnumMetadata::GetLast() { +inline AudioEngine EnumMetadata::GetLast() { return AudioEngine::Oboe; } ENUM(AudioMode, Mono, Stereo, Surround); -static_assert(EnumMetadata::GetFirst() == AudioMode::Mono); -static_assert(EnumMetadata::GetLast() == AudioMode::Surround); +//static_assert(EnumMetadata::GetFirst() == AudioMode::Mono); +//static_assert(EnumMetadata::GetLast() == AudioMode::Surround); ENUM(Language, Japanese, EnglishAmerican, French, German, Italian, Spanish, Chinese, Korean, Dutch, Portuguese, Russian, Taiwanese, EnglishBritish, FrenchCanadian, SpanishLatin,