1/* 2 * Copyright (c) 2005-2008, Message Systems, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: 8 * 9 * * Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * * Redistributions in binary form must reproduce the above 12 * copyright notice, this list of conditions and the following 13 * disclaimer in the documentation and/or other materials provided 14 * with the distribution. 15 * * Neither the name Message Systems, Inc. nor the names 16 * of its contributors may be used to endorse or promote products 17 * derived from this software without specific prior written 18 * permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#ifndef __JLOG_CONFIG_H 34#define __JLOG_CONFIG_H 35 36/* define inline unless that is what the compiler already calls it. */ 37#undef inline 38 39#undef HAVE_FCNTL_H 40#undef HAVE_SYS_TYPES_H 41#undef HAVE_DIRENT_H 42#undef HAVE_ERRNO_H 43#undef HAVE_STRING_H 44#undef HAVE_STDLIB_H 45#undef HAVE_UNISTD_H 46#undef HAVE_SYS_PARAM_H 47#undef HAVE_SYS_MMAN_H 48#undef HAVE_TIME_H 49#undef HAVE_SYS_TIME_H 50#undef HAVE_SYS_STAT_H 51#undef HAVE_INT64_T 52#undef HAVE_INTXX_T 53#undef HAVE_LONG_LONG_INT 54#undef HAVE_UINTXX_T 55#undef HAVE_U_INT 56#undef HAVE_U_INT64_T 57#undef HAVE_U_INTXX_T 58#define IFS_CH '/' 59 60#include <stdint.h> 61#ifdef HAVE_STRING_H 62#include <string.h> 63#endif 64#ifdef HAVE_STDLIB_H 65#include <stdlib.h> 66#endif 67#ifdef HAVE_SYS_PARAM_H 68#include <sys/param.h> 69#endif 70#ifdef HAVE_SYS_TYPES_H 71#include <sys/types.h> 72#endif 73#ifdef HAVE_SYS_STAT_H 74#include <sys/stat.h> 75#endif 76 77/* The number of bytes in a char. */ 78#undef SIZEOF_CHAR 79 80/* The number of bytes in a int. */ 81#undef SIZEOF_INT 82 83/* The number of bytes in a size_t. */ 84#undef SIZEOF_SIZE_T 85 86 87/* The number of bytes in a long int. */ 88#undef SIZEOF_LONG_INT 89 90/* The number of bytes in a long long int. */ 91#undef SIZEOF_LONG_LONG_INT 92 93/* The number of bytes in a short int. */ 94#undef SIZEOF_SHORT_INT 95 96/* The number of bytes in a void *. */ 97#undef SIZEOF_VOID_P 98 99#ifndef HAVE_U_INT 100typedef unsigned int u_int; 101#endif 102 103#undef HAVE_INTXX_T 104#ifndef HAVE_INTXX_T 105#if (SIZEOF_CHAR == 1) 106typedef char int8_t; 107#else 108#error "8 bit int type not found." 109#endif 110#if (SIZEOF_SHORT_INT == 2) 111typedef short int int16_t; 112#else 113#ifdef _CRAY 114typedef long int16_t; 115#else 116#warning "16 bit int type not found." 117#endif /* _CRAY */ 118#endif 119#if (SIZEOF_INT == 4) 120typedef int int32_t; 121#else 122#ifdef _CRAY 123typedef long int32_t; 124#else 125#error "32 bit int type not found." 126#endif /* _CRAY */ 127#endif 128#endif 129 130/* If sys/types.h does not supply u_intXX_t, supply them ourselves */ 131#ifndef HAVE_U_INTXX_T 132#ifdef HAVE_UINTXX_T 133typedef uint8_t u_int8_t; 134typedef uint16_t u_int16_t; 135typedef uint32_t u_int32_t; 136#define HAVE_U_INTXX_T 1 137#else 138#if (SIZEOF_CHAR == 1) 139typedef unsigned char u_int8_t; 140#else 141#error "8 bit int type not found." 142#endif 143#if (SIZEOF_SHORT_INT == 2) 144typedef unsigned short int u_int16_t; 145#else 146#ifdef _CRAY 147typedef unsigned long u_int16_t; 148#else 149#warning "16 bit int type not found." 150#endif 151#endif 152#if (SIZEOF_INT == 4) 153typedef unsigned int u_int32_t; 154#else 155#ifdef _CRAY 156typedef unsigned long u_int32_t; 157#else 158#error "32 bit int type not found." 159#endif 160#endif 161#endif 162#endif 163 164/* 64-bit types */ 165#ifndef HAVE_INT64_T 166#if (SIZEOF_LONG_INT == 8) 167typedef long int int64_t; 168#define HAVE_INT64_T 1 169#else 170#if (SIZEOF_LONG_LONG_INT == 8) 171typedef long long int int64_t; 172#define HAVE_INT64_T 1 173#define HAVE_LONG_LONG_INT 174#endif 175#endif 176#endif 177#ifndef HAVE_U_INT64_T 178#if (SIZEOF_LONG_INT == 8) 179typedef unsigned long int u_int64_t; 180#define HAVE_U_INT64_T 1 181#else 182#if (SIZEOF_LONG_LONG_INT == 8) 183typedef unsigned long long int u_int64_t; 184#define HAVE_U_INT64_T 1 185#endif 186#endif 187#endif 188 189#endif 190