added include guards to compatibility headers

This commit is contained in:
Frank Morgner 2019-01-14 11:14:20 +01:00
parent 6bf7c0d219
commit 745b8cf420
3 changed files with 29 additions and 2 deletions

View File

@ -1,9 +1,18 @@
/**
* @file
* @brief prototypes of strlcpy()/strlcat() imported from OpenBSD
* @brief prototypes of strlcat() imported from OpenBSD
*/
#ifndef __COMPAT_STRLCAT_H
#define __COMPAT_STRLCAT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef HAVE_STRLCAT
#include <stddef.h>
size_t strlcat(char *dst, const char *src, size_t siz);
#endif
#endif

View File

@ -28,10 +28,19 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/**
* @file
* @brief prototypes of strlcpy()/strlcat() imported from OpenBSD
* @brief prototypes of strlcpy() imported from OpenBSD
*/
#ifndef __COMPAT_STRLCPY_H
#define __COMPAT_STRLCPY_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef HAVE_STRLCPY
#include <stddef.h>
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
#endif

View File

@ -3,7 +3,16 @@
* @brief prototype of strnlen() from OpenBSD
*/
#ifndef __COMPAT_STRNLEN_H
#define __COMPAT_STRNLEN_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef HAVE_STRNLEN
#include <stddef.h>
size_t strnlen(const char *str, size_t maxlen);
#endif
#endif