view libmlk-core/core/port.h @ 313:dbfe05b88627

cmake: bring back for good It's just too complicated to get portability done right using pure GNU make and since we're targeting more OSes than Linux we have to incorporate some portability bits.
author David Demelier <markand@malikania.fr>
date Wed, 22 Sep 2021 07:19:32 +0200
parents 0858e33a762d
children d01e83210ca2
line wrap: on
line source

/*
 * port.h -- portability bits
 *
 * Copyright (c) 2020 David Demelier <markand@malikania.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef MOLKO_CORE_PORT_H
#define MOLKO_CORE_PORT_H

#include "config.h"

/* {{{ strlcpy (BSD extension, incoming in next POSIX). */

#if !defined(MLK_HAS_STRLCPY)

#include <stddef.h>

size_t
strlcpy(char *, const char *, size_t);

#endif /* !MLK_HAS_STRLCPY */

/* }}} */

/* {{{ fmemopen (POSIX). */

#if !defined(MLK_HAS_FMEMOPEN)

#include <stdio.h>

FILE *
fmemopen(void *, size_t, const char *);

#endif /* !MLK_HAS_FMEMOPEN */

/* }}} */

#endif /* !MOLKO_CORE_PORT_H */