nancy.liao
1 天以前 11f2f2e329ef404d0e9c022cb2f9fbbb45bae285
libscpi/inc/scpi/cc.h
@@ -1,28 +1,29 @@
/*-
 * Copyright (c) 2012-2013 Jan Breuer,
 * BSD 2-Clause License
 *
 * All Rights Reserved
 * Copyright (c) 2012-2018, Jan Breuer
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * modification, are permitted provided that the following conditions are met:
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/**
@@ -53,37 +54,63 @@
# endif
#endif
#if POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
#if defined(__cplusplus)
# if (__cplusplus >= 199711)
#  define CXX98 1
# endif
#endif
#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200809L) || \
    (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 700)
    #define HAVE_STRNDUP 1
    #define HAVE_STRNLEN 1
#endif
#if _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99
#if (defined _BSD_SOURCE && _BSD_SOURCE) || \
    (defined _XOPEN_SOURCE  && _XOPEN_SOURCE >= 500) || \
    (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \
    (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \
    C99
    #define HAVE_SNPRINTF 1
#endif
#if _POSIX_C_SOURCE >= 200112L
#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L)
    #define HAVE_STRNCASECMP 1
#endif
#if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99
#if (defined _BSD_SOURCE && _BSD_SOURCE) || \
    (defined _SVID_SOURCE && _SVID_SOURCE) || \
    (defined _XOPEN_SOURCE && _XOPEN_SOURCE) || \
    (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \
    (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) ||\
    C99
    #define HAVE_ISNAN 1
#endif
#if _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99
#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 600)|| \
    (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \
    (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \
    C99
    #define HAVE_ISFINITE 1
    #define HAVE_SIGNBIT 1
#endif
#if XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
#if (defined _XOPEN_SOURCE && XOPEN_SOURCE >= 600) || \
    (defined _BSD_SOURCE && _BSD_SOURCE) || \
    (defined _SVID_SOURCE && _SVID_SOURCE) || \
    (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \
    (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L)
    #define HAVE_STRTOLL 1
#endif
#if _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99
#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 600) || \
    (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \
    (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \
    C99
    #define HAVE_STRTOF 1
#endif
#if _ISOC99_SOURCE || C99
#if (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || C99 || CXX98
    #define HAVE_STDBOOL 1
#endif
@@ -116,6 +143,8 @@
#if defined(__AVR__)
#include <stdlib.h>
#define HAVE_DTOSTRE            1
#undef HAVE_STRTOF
#define HAVE_STRTOF            0
#endif
/* default values */
@@ -125,6 +154,10 @@
#ifndef HAVE_STRDUP
#define HAVE_STRDUP             0
#endif
#ifndef HAVE_STRNDUP
#define HAVE_STRNDUP             0
#endif
#ifndef HAVE_STRNICMP
@@ -167,8 +200,12 @@
#define HAVE_STRTOF             0
#endif
#ifndef  HAVE_DTOSTRE
#define  HAVE_DTOSTRE           0
#endif
#ifdef   __cplusplus
}
#endif
#endif /* __SCPI_CC_H_ */
#endif /* __SCPI_CC_H_ */