mirror of https://github.com/ArduPilot/ardupilot
desktop: removed the need for libbsd
this should help the cygwin build that MikeO is working on
This commit is contained in:
parent
e2c6dc68a2
commit
e991d81eee
|
@ -116,7 +116,7 @@ CFLAGS = -g $(DEFINES) $(OPTFLAGS) $(DEPFLAGS) $(COPTS)
|
|||
ASFLAGS = -g $(DEFINES) $(DEPFLAGS) $(ASOPTS)
|
||||
LDFLAGS = -g $(OPTFLAGS) -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP)
|
||||
|
||||
LIBS = -lm -lbsd
|
||||
LIBS = -lm
|
||||
|
||||
SRCSUFFIXES = *.cpp *.c
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <bsd/string.h>
|
||||
#include "avr/pgmspace.h"
|
||||
#include <BetterStream.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -43,9 +42,23 @@ void delay(long unsigned msec)
|
|||
usleep(msec*1000);
|
||||
}
|
||||
|
||||
size_t strlcat_P(char *dst, PGM_P src, size_t size)
|
||||
size_t strlcat_P(char *d, PGM_P s, size_t bufsize)
|
||||
{
|
||||
return strlcat(dst, src, size);
|
||||
size_t len1 = strlen(d);
|
||||
size_t len2 = strlen(s);
|
||||
size_t ret = len1 + len2;
|
||||
|
||||
if (len1+len2 >= bufsize) {
|
||||
if (bufsize < (len1+1)) {
|
||||
return ret;
|
||||
}
|
||||
len2 = bufsize - (len1+1);
|
||||
}
|
||||
if (len2 > 0) {
|
||||
memcpy(d+len1, s, len2);
|
||||
d[len1+len2] = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t strnlen_P(PGM_P str, size_t size)
|
||||
|
|
Loading…
Reference in New Issue