/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* generate limits features
*
* FOPEN_MAX POSIX says ANSI defines it but it's not in ANSI
*
* NOTE: two's complement binary integral representation assumed
*/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#else
#define getpagesize ______getpagesize
#define getdtablesize ______getdtablesize
#endif
/*
* we'd like as many symbols as possible defined
* the standards push the vendors the other way
* but don't provide guard that lets everything through
* so each vendor adds their own guard
* many now include something like <standards.h> to
* kick that in
*/
#ifdef __sun
#endif
#if _hdr_limits
#include <limits.h>
#endif
#define _SGIAPI 0
#if _hdr_unistd
#include <unistd.h>
#endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#else
#endif
int main()
{
char c;
unsigned char uc;
unsigned short us;
unsigned int ui;
unsigned long ul;
unsigned long val;
#if _typ_uint64_t
#endif
/*
* <limits.h> with *constant* valued macros
*/
printf("\n");
#ifndef CHAR_BIT
uc = 0;
val = 1;
#endif
#ifndef MB_LEN_MAX
val = 1;
#endif
c = 0;
c = ~c;
uc = 0;
us = 0;
ui = 0;
ul = 0;
#if _typ_uint64_t
ull = 0;
#endif
#ifndef UCHAR_MAX
printf("#if defined(__STDC__)\n");
printf("#else\n");
printf("#endif\n");
#endif
#ifndef SCHAR_MIN
#endif
#ifndef SCHAR_MAX
#endif
if (c < 0)
{
#ifndef CHAR_MIN
printf("#define CHAR_MIN SCHAR_MIN\n");
#endif
#ifndef CHAR_MAX
printf("#define CHAR_MAX SCHAR_MAX\n");
#endif
}
else
{
#ifndef CHAR_MIN
printf("#define CHAR_MIN 0\n");
#endif
#ifndef CHAR_MAX
printf("#define CHAR_MAX UCHAR_MAX\n");
#endif
}
#ifndef USHRT_MAX
printf("#if defined(__STDC__)\n");
printf("#else\n");
printf("#endif\n");
#endif
#ifndef SHRT_MIN
#endif
#ifndef SHRT_MAX
#endif
{
#ifndef UINT_MAX
printf("#define UINT_MAX USHRT_MAX\n");
#endif
#ifndef INT_MIN
printf("#define INT_MIN SHRT_MIN\n");
#endif
#ifndef INT_MAX
printf("#define INT_MAX SHRT_MAX\n");
#endif
}
else
{
#ifndef UINT_MAX
printf("#if defined(__STDC__)\n");
printf("#else\n");
printf("#endif\n");
#endif
#ifndef INT_MIN
#endif
#ifndef INT_MAX
#endif
}
{
#ifndef ULONG_MAX
printf("#define ULONG_MAX UINT_MAX\n");
#endif
#ifndef LONG_MIN
printf("#define LONG_MIN INT_MIN\n");
#endif
#ifndef LONG_MAX
printf("#define LONG_MAX INT_MAX\n");
#endif
}
else
{
#ifndef ULONG_MAX
printf("#if defined(__STDC__)\n");
printf("#else\n");
printf("#endif\n");
#endif
#ifndef LONG_MIN
#endif
#ifndef LONG_MAX
#endif
}
#if _typ_uint64_t && !_ast_intmax_long
{
#ifndef ULLONG_MAX
printf("#define ULLONG_MAX ULONG_MAX\n");
#endif
#ifndef LLONG_MIN
printf("#define LLONG_MIN LONG_MIN\n");
#endif
#ifndef LLONG_MAX
printf("#define LLONG_MAX LONG_MAX\n");
#endif
}
else
{
#ifndef ULLONG_MAX
printf("#ifndef ULLONG_MAX\n");
printf("#if defined(__STDC__) && _ast_LL\n");
printf("#else\n");
printf("#endif\n");
printf("#endif\n");
#endif
#ifndef LLONG_MIN
printf("#ifndef LLONG_MIN\n");
printf("#if defined(__STDC__) && _ast_LL\n");
printf("#else\n");
printf("#endif\n");
printf("#endif\n");
#endif
#ifndef LLONG_MAX
printf("#ifndef LLONG_MAX\n");
printf("#if defined(__STDC__) && _ast_LL\n");
printf("#else\n");
printf("#endif\n");
printf("#endif\n");
#endif
}
#endif
printf("\n");
#ifdef _UWIN
printf("#ifdef _UWIN\n");
printf("#ifndef DBL_DIG\n");
printf("#define DBL_DIG 15\n");
printf("#endif\n");
printf("#ifndef DBL_MAX\n");
printf("#define DBL_MAX 1.7976931348623158e+308\n");
printf("#endif\n");
printf("#ifndef FLT_DIG\n");
printf("#define FLT_DIG 6\n");
printf("#endif\n");
printf("#ifndef FLT_MAX\n");
printf("#define FLT_MAX 3.402823466e+38F\n");
printf("#endif\n");
printf("#endif\n");
printf("\n");
#endif
#include "conflim.h"
printf("\n");
return 0;
}