Message ID | 20181018130628.17133-2-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] Fix compilation on FreeBSD broken by __u64 usage | expand |
On 18/10/18 15:06, Christian Storm wrote: > Like strndupa() already in compat.h, strdupa() is not > defined on the BSDs. Commit 62476e3 makes use of it > and hence broke builds on FreeBSD. > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > include/compat.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/compat.h b/include/compat.h > index 8bbce90..3f69dfb 100644 > --- a/include/compat.h > +++ b/include/compat.h > @@ -23,6 +23,10 @@ > })) > #endif > > +#ifndef strdupa > +#define strdupa(s) strndupa(s, strlen(s)) > +#endif > + > #if defined(__FreeBSD__) > /* > * Define ENODATA (61 - No data available) to > Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/include/compat.h b/include/compat.h index 8bbce90..3f69dfb 100644 --- a/include/compat.h +++ b/include/compat.h @@ -23,6 +23,10 @@ })) #endif +#ifndef strdupa +#define strdupa(s) strndupa(s, strlen(s)) +#endif + #if defined(__FreeBSD__) /* * Define ENODATA (61 - No data available) to
Like strndupa() already in compat.h, strdupa() is not defined on the BSDs. Commit 62476e3 makes use of it and hence broke builds on FreeBSD. Signed-off-by: Christian Storm <christian.storm@siemens.com> --- include/compat.h | 4 ++++ 1 file changed, 4 insertions(+)