diff --git a/src/include/general.h b/src/include/general.h index 6df94b1dc87..e4c0093924c 100644 --- a/src/include/general.h +++ b/src/include/general.h @@ -35,7 +35,8 @@ #endif #if defined(_WIN32) || defined(__CYGWIN__) #include -#else +/* `alloca()` on FreeBSD is visible from , and does not exist */ +#elif !defined(__FreeBSD__) #include #endif #include diff --git a/src/platforms/hosted/Makefile.inc b/src/platforms/hosted/Makefile.inc index 4247fc04732..9a3c4b632f8 100644 --- a/src/platforms/hosted/Makefile.inc +++ b/src/platforms/hosted/Makefile.inc @@ -44,6 +44,10 @@ HIDAPILIB = hidapi ifneq (,$(findstring linux,$(SYS))) SRC += serial_unix.c HIDAPILIB = hidapi-hidraw +else ifneq (,$(findstring freebsd,$(SYS))) + # On FreeBSD, only the hidapi on libusb-1.0 variant exists + SRC += serial_unix.c + HIDAPILIB = hidapi else ifneq (,$(findstring mingw,$(SYS))) FLAVOUR = $(shell which $(CC)) ifneq (,$(findstring ucrt64,$(FLAVOUR)))