Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building hosted under FreeBSD #1696

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
#include "traceswo.h"
#endif

#if defined(_WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif

static bool cmd_version(target_s *t, int argc, const char **argv);
static bool cmd_help(target_s *t, int argc, const char **argv);

Expand Down
5 changes: 0 additions & 5 deletions src/gdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
#define GDB_QSUPPORTED_NOACKMODE
#endif

#if defined(_WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
#include <stdlib.h>

typedef enum gdb_signal {
Expand Down
3 changes: 2 additions & 1 deletion src/include/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#include <malloc.h>
#else
/* `alloca()` on FreeBSD is visible from <stdlib.h>, and <alloca.h> does not exist */
#elif !defined(__FreeBSD__)
#include <alloca.h>
#endif
#include <stdint.h>
Expand Down
4 changes: 4 additions & 0 deletions src/platforms/hosted/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
5 changes: 0 additions & 5 deletions src/target/cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@

#include <string.h>
#include <assert.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#include <malloc.h>
#else
#include <alloca.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down