/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CMOCKA_PRIVATE_H_
#define CMOCKA_PRIVATE_H_
#include "config.h"
#include <stdint.h>
#ifdef _WIN32
#include <windows.h>
# ifdef _MSC_VER
# include <stdio.h> /* _snprintf */
# undef inline
# define inline __inline
# if defined(HAVE__SNPRINTF_S)
# else /* HAVE__SNPRINTF_S */
# if defined(HAVE__SNPRINTF)
# else /* HAVE__SNPRINTF */
# if !defined(HAVE_SNPRINTF)
# error "no snprintf compatible function found"
# endif /* HAVE_SNPRINTF */
# endif /* HAVE__SNPRINTF */
# endif /* HAVE__SNPRINTF_S */
# if defined(HAVE__VSNPRINTF_S)
# else /* HAVE__VSNPRINTF_S */
# if defined(HAVE__VSNPRINTF)
# else
# if !defined(HAVE_VSNPRINTF)
# error "No vsnprintf compatible function found"
# endif /* HAVE_VSNPRINTF */
# endif /* HAVE__VSNPRINTF */
# endif /* HAVE__VSNPRINTF_S */
# endif /* _MSC_VER */
/*
* Backwards compatibility with headers shipped with Visual Studio 2005 and
* earlier.
*/
#ifndef PRIdS
#endif
#ifndef PRIu64
#endif
#ifndef PRIuMAX
#endif
#ifndef PRIxMAX
#endif
#ifndef PRIXMAX
#endif
#else /* _WIN32 */
#ifndef __PRI64_PREFIX
# if __WORDSIZE == 64
# else
# endif
#endif
#ifndef PRIdS
#endif
#ifndef PRIu64
#endif
#ifndef PRIuMAX
#endif
#ifndef PRIxMAX
#endif
#ifndef PRIXMAX
#endif
#endif /* _WIN32 */
/** Free memory space */
/** Zero a structure */
/** Zero a structure given a pointer to the structure */
/** Get the size of an array */
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
/** Overwrite the complete string with 'X' */
/**
* This is a hack to fix warnings. The idea is to use this everywhere that we
* get the "discarding const" warning by the compiler. That doesn't actually
* fix the real issue, but marks the place and you can search the code for
* discard_const.
*
* Please use this macro only when there is no other way to fix the warning.
* We should use this function in only in a very few places.
*
* Also, please call this via the discard_const_p() macro interface, as that
* makes the return type safe.
*/
/**
* Type-safe version of discard_const
*/
#endif /* CMOCKA_PRIVATE_H_ */