# HG changeset patch # User Guido Berhoerster # Date 1501222838 -7200 # Node ID 25e227eba3daced81e9681a1f5d02c9ad114df23 # Parent bec6f94453ecada8785121bf74fd3d9aaf6beb46 Fix asprintf compatibility code Ensure compat/asprintf.o is built on platforms not providing asprintf. Define the _GNU_SOURCE feature macro for the glib asprintf prototype. diff -r bec6f94453ec -r 25e227eba3da Makefile --- a/Makefile Fri Jul 28 08:11:30 2017 +0200 +++ b/Makefile Fri Jul 28 08:20:38 2017 +0200 @@ -136,6 +136,11 @@ XCPPFLAGS = -DPACKAGE=\"$(PACKAGE)\" \ -DVERSION=\"$(VERSION)\" LDLIBS = -lpws -lnettle +ifeq ($(HAVE_ASPRINTF),1) + XCPPFLAGS += -DHAVE_ASPRINTF +else + OBJS += compat/asprintf.o +endif ifeq ($(HAVE_ERR_H),1) XCPPFLAGS += -DHAVE_ERR_H else diff -r bec6f94453ec -r 25e227eba3da compat.h --- a/compat.h Fri Jul 28 08:11:30 2017 +0200 +++ b/compat.h Fri Jul 28 08:20:38 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Guido Berhoerster + * Copyright (C) 2017 Guido Berhoerster * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,7 +25,7 @@ #define COMPAT_H /* for glibc asprintf, getline */ -#define _BSD_SOURCE +#define _GNU_SOURCE #ifndef HAVE_ASPRINTF #include "compat/asprintf.h"