Mercurial > projects > pwm
comparison compat.h @ 8:25e227eba3da
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.
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Fri, 28 Jul 2017 08:20:38 +0200 |
parents | a7e41e1a79c8 |
children | a08ef0674d8e |
comparison
equal
deleted
inserted
replaced
7:bec6f94453ec | 8:25e227eba3da |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2016 Guido Berhoerster <guido+pwm@berhoerster.name> | 2 * Copyright (C) 2017 Guido Berhoerster <guido+pwm@berhoerster.name> |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
5 * a copy of this software and associated documentation files (the | 5 * a copy of this software and associated documentation files (the |
6 * "Software"), to deal in the Software without restriction, including | 6 * "Software"), to deal in the Software without restriction, including |
7 * without limitation the rights to use, copy, modify, merge, publish, | 7 * without limitation the rights to use, copy, modify, merge, publish, |
23 | 23 |
24 #ifndef COMPAT_H | 24 #ifndef COMPAT_H |
25 #define COMPAT_H | 25 #define COMPAT_H |
26 | 26 |
27 /* for glibc asprintf, getline */ | 27 /* for glibc asprintf, getline */ |
28 #define _BSD_SOURCE | 28 #define _GNU_SOURCE |
29 | 29 |
30 #ifndef HAVE_ASPRINTF | 30 #ifndef HAVE_ASPRINTF |
31 #include "compat/asprintf.h" | 31 #include "compat/asprintf.h" |
32 #endif /* !HAVE_ASPRINTF */ | 32 #endif /* !HAVE_ASPRINTF */ |
33 | 33 |