Skip to content
Open
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
10 changes: 10 additions & 0 deletions compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#ifndef HAVE_BZERO
# define bzero(buf, len) memset ((buf), 0, (len));
#else
void bzero(void *s, size_t n);
#endif

#ifndef HAVE_STRTONUM
Expand All @@ -55,4 +57,12 @@ long long strtonum (const char *, long long, long long, const char **);
char *fgetln (FILE *, size_t *);
#endif

#ifdef HAVE_SNPRINTF
int snprintf(char *restrict s, size_t n, const char *restrict format, ...);
#endif

#ifdef HAVE_GETOPT
# include <getopt.h>
#endif

#endif /* COMPAT_H */
15 changes: 15 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ EOF
cat <<EOF >>$CONFIG_MK
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE
LIBS+= -lncurses
SRCS+= compat/fgetln.c \
compat/strtonum.c
EOF
;;
# ------------------------------------------------------------------------------
Darwin)
cat <<EOF >>$CONFIG_H
#define HAVE_NCURSES_H
#define HAVE_BZERO
#define HAVE_SNPRINTF
#define HAVE_GETOPT
EOF
cat <<EOF >>$CONFIG_MK
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE
LIBS+= -lncurses
SRCS+= compat/fgetln.c \
compat/strtonum.c
EOF
Expand Down