#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#include <stdio.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "cputime.h"
#include "lbn16.h"
#define NO_STRING_H !HAVE_STRING_H
#define HAVE_STRINGS_H 0
-#define NEED_MEMORY_H 0
/* We go to some trouble to find accurate times... */
/* Defines for various kinds of library brokenness */
-/* Define if <stdio.h> is missing prototypes (= lots of warnings!) */
-#define NO_STDIO_PROTOS 0
-
-/* Define if <assert.h> depends on <stdio.h> and breaks without it */
-#define ASSERT_NEEDS_STDIO 0
-/* Define if <assert.h> depends on <stdlib.h> and complains without it */
-#define ASSERT_NEEDS_STDLIB 0
-
-/*
- * Define if <string.h> delcares the mem* functions to take char *
- * instead of void * parameters (= lots of warnings)
- */
-#define MEM_PROTOS_BROKEN 0
-
/* If not available, bcopy() is substituted */
#define HAVE_MEMMOVE 1
#define NO_MEMMOVE !HAVE_MEMMOVE
* Some compilers complain about #if FOO if FOO isn't defined,
* so do the ANSI-mandated thing explicitly...
*/
-#ifndef ASSERT_NEEDS_STDIO
-#define ASSERT_NEEDS_STDIO 0
-#endif
-#ifndef ASSERT_NEEDS_STDLIB
-#define ASSERT_NEEDS_STDLIB 0
-#endif
#ifndef NO_STDLIB_H
#define NO_STDLIB_H 0
#endif
-/* SunOS 4.1.x <assert.h> needs "stderr" defined, and "exit" declared... */
-#ifdef assert
-#if ASSERT_NEEDS_STDIO
-#include <stdio.h>
-#endif
-#if ASSERT_NEEDS_STDLIB
-#if !NO_STDLIB_H
-#include <stdlib.h>
-#endif
-#endif
-#endif
-
#ifndef NO_MEMMOVE
#define NO_MEMMOVE 0
#endif
#define memcpy(dest,src,len) bcopy(src,dest,len)
#endif
-#ifndef MEM_PROTOS_BROKEN
-#define MEM_PROTOS_BROKEN 0
-#endif
-#if MEM_PROTOS_BROKEN
-#define memcpy(d,s,l) memcpy((void *)(d), (void const *)(s), l)
-#define memmove(d,s,l) memmove((void *)(d), (void const *)(s), l)
-#define memcmp(d,s,l) memcmp((void const *)(d), (void const *)(s), l)
-#define memset(d,v,l) memset((void *)(d), v, l)
-#endif
-
-/*
- * If there are no prototypes for the stdio functions, use these to
- * reduce compiler warnings. Uses EOF as a giveaway to indicate
- * that <stdio.h> was #included.
- */
-#ifndef NO_STDIO_PROTOS
-#define NO_STDIO_PROTOS 0
-#endif
-#if NO_STDIO_PROTOS /* Missing prototypes for "simple" functions */
-#ifdef EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-int (puts)(char const *);
-int (fputs)(char const *, FILE *);
-int (fflush)(FILE *);
-int (printf)(char const *, ...);
-int (fprintf)(FILE *, char const *, ...);
-/* If we have a sufficiently old-fashioned stdio, it probably uses these... */
-int (_flsbuf)(int, FILE *);
-int (_filbuf)(FILE *);
-#ifdef __cplusplus
-}
-#endif
-#endif /* EOF */
-#endif /* NO_STDIO_PROTOS */
-
/*
* Borland C seems to think that it's a bad idea to decleare a
* structure tag and not declare the contents. I happen to think
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn.h"
#include "lbn16.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_STDLIB_H
#include <stdlib.h> /* For malloc() & co. */
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#ifndef DBMALLOC
#define DBMALLOC 0
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
/*
* This was useful during debugging, so it's left in here.
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
/*
* This was useful during debugging, so it's left in here.
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
/*
* This was useful during debugging, so it's left in here.
#define NO_STRING_H !HAVE_STRING_H
#define HAVE_STRINGS_H 0
-#define NEED_MEMORY_H 0
/* We go to some trouble to find accurate times... */
/* Defines for various kinds of library brokenness */
-/* Define if <stdio.h> is missing prototypes (= lots of warnings!) */
-#define NO_STDIO_PROTOS 0
-
-/* Define if <assert.h> depends on <stdio.h> and breaks without it */
-#define ASSERT_NEEDS_STDIO 0
-/* Define if <assert.h> depends on <stdlib.h> and complains without it */
-#define ASSERT_NEEDS_STDLIB 0
-
-/*
- * Define if <string.h> delcares the mem* functions to take char *
- * instead of void * parameters (= lots of warnings)
- */
-#define MEM_PROTOS_BROKEN 0
-
/* If not available, bcopy() is substituted */
#define HAVE_MEMMOVE 0
#define NO_MEMMOVE !HAVE_MEMMOVE
#define NO_STRING_H !HAVE_STRING_H
#define HAVE_STRINGS_H 0
-#define NEED_MEMORY_H 0
/* We go to some trouble to find accurate times... */
/* Defines for various kinds of library brokenness */
-/* Define if <stdio.h> is missing prototypes (= lots of warnings!) */
-#define NO_STDIO_PROTOS 0
-
-/* Define if <assert.h> depends on <stdio.h> and breaks without it */
-#define ASSERT_NEEDS_STDIO 0
-/* Define if <assert.h> depends on <stdlib.h> and complains without it */
-#define ASSERT_NEEDS_STDLIB 0
-
-/*
- * Define if <string.h> delcares the mem* functions to take char *
- * instead of void * parameters (= lots of warnings)
- */
-#define MEM_PROTOS_BROKEN 0
-
/* If not available, bcopy() is substituted */
#define HAVE_MEMMOVE 1
#define NO_MEMMOVE !HAVE_MEMMOVE
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#include <stdio.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn16.h"
#include "kludge.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#include <stdio.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn32.h"
#include "kludge.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#include <stdio.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn64.h"
#include "kludge.h"
AC_CHECK_HEADERS(assert.h limits.h stdlib.h string.h)
-# Do we want to include memory.h?
-if test $ac_cv_header_string_h = no; then
-AC_CHECK_HEADERS(strings.h)
-ac_found=no
-else
-AC_MSG_CHECKING(whether string.h declares mem functions)
-AC_EGREP_HEADER(memset, string.h, ac_found=yes, ac_found=no)
-AC_MSG_RESULT($ac_found)
-fi
-# ac_found is now "yes" if string.h exists and declares the mem*
-# functions. If not, see if memory.h exists and include that
-# as well.
-if test $ac_found = no; then
-AC_CHECK_HEADER(memory,h. [AC_DEFINE(NEED_MEMORY_H)])
-fi
-
-AC_CACHE_CHECK(whether <stdio.h> provides prototypes,
-bn_cv_header_stdio_protos,
-[AC_EGREP_HEADER(printf, stdio.h, bn_cv_header_stdio_protos=yes, bn_cv_header_stdio_protos=no)
-])
-if test $bn_cv_header_stdio_protos = no; then
- AC_DEFINE(NO_STDIO_PROTOS)
-fi
-
fi
# ^^ End of non-ANSI header brokenness tests (first part)
-AC_CACHE_CHECK(whether <string.h> declares mem* wrong.,
-bn_cv_header_mem_broken,
-[AC_EGREP_HEADER(memcpy.*char, string.h, bn_cv_header_mem_broken=yes, bn_cv_header_mem_broken=no)
-])
-if test $bn_cv_header_mem_broken = yes; then
- AC_DEFINE(MEM_PROTOS_BROKEN)
-fi
-
-# SunOS 4.1.x acc's <assert.h> is broken
-AC_CACHE_CHECK(whether <assert.h> is broken and needs <stdio.h>,
-bn_cv_header_assert_needs_stdio,
-[AC_EGREP_CPP(stderr,
-[#include <assert.h>
-assert(foo)
-], bn_cv_header_assert_needs_stdio=yes, bn_cv_header_assert_needs_stdio=no)
-])
-if test $bn_cv_header_assert_needs_stdio = yes; then
- AC_DEFINE(ASSERT_NEEDS_STDIO)
-fi
-
-AC_CACHE_CHECK(whether <assert.h> is broken and needs <stdlib.h>,
-bn_cv_header_assert_needs_stdlib,
-[AC_EGREP_CPP(exit,
-[#include <assert.h>
-assert(foo)
-], bn_cv_header_assert_needs_stdlib=yes, bn_cv_header_assert_needs_stdlib=no)
-])
-if test $bn_cv_header_assert_needs_stdlib = yes; then
- AC_DEFINE(ASSERT_NEEDS_STDLIB)
-fi
-
# Check that we have <sys/time.h> explicitly.
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include <stdlib.h> /* For malloc() */
* Some compilers complain about #if FOO if FOO isn't defined,
* so do the ANSI-mandated thing explicitly...
*/
-#ifndef ASSERT_NEEDS_STDIO
-#define ASSERT_NEEDS_STDIO 0
-#endif
-#ifndef ASSERT_NEEDS_STDLIB
-#define ASSERT_NEEDS_STDLIB 0
-#endif
#ifndef NO_STDLIB_H
#define NO_STDLIB_H 0
#endif
-/* SunOS 4.1.x <assert.h> needs "stderr" defined, and "exit" declared... */
-#ifdef assert
-#if ASSERT_NEEDS_STDIO
-#include <stdio.h>
-#endif
-#if ASSERT_NEEDS_STDLIB
-#if !NO_STDLIB_H
-#include <stdlib.h>
-#endif
-#endif
-#endif
-
#ifndef NO_MEMMOVE
#define NO_MEMMOVE 0
#endif
#define memcpy(dest,src,len) bcopy(src,dest,len)
#endif
-#ifndef MEM_PROTOS_BROKEN
-#define MEM_PROTOS_BROKEN 0
-#endif
-#if MEM_PROTOS_BROKEN
-#define memcpy(d,s,l) memcpy((void *)(d), (void const *)(s), l)
-#define memmove(d,s,l) memmove((void *)(d), (void const *)(s), l)
-#define memcmp(d,s,l) memcmp((void const *)(d), (void const *)(s), l)
-#define memset(d,v,l) memset((void *)(d), v, l)
-#endif
-
-/*
- * If there are no prototypes for the stdio functions, use these to
- * reduce compiler warnings. Uses EOF as a giveaway to indicate
- * that <stdio.h> was #included.
- */
-#ifndef NO_STDIO_PROTOS
-#define NO_STDIO_PROTOS 0
-#endif
-#if NO_STDIO_PROTOS /* Missing prototypes for "simple" functions */
-#ifdef EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-int (puts)(char const *);
-int (fputs)(char const *, FILE *);
-int (fflush)(FILE *);
-int (printf)(char const *, ...);
-int (fprintf)(FILE *, char const *, ...);
-/* If we have a sufficiently old-fashioned stdio, it probably uses these... */
-int (_flsbuf)(int, FILE *);
-int (_filbuf)(FILE *);
-#ifdef __cplusplus
-}
-#endif
-#endif /* EOF */
-#endif /* NO_STDIO_PROTOS */
-
/*
* Borland C seems to think that it's a bad idea to decleare a
* structure tag and not declare the contents. I happen to think
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn.h"
#include "lbn16.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn.h"
#include "lbn32.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "lbn.h"
#include "lbn64.h"
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_STDLIB_H
#include <stdlib.h> /* For malloc() & co. */
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#ifndef DBMALLOC
#define DBMALLOC 0
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 0
#endif
-#ifndef NEED_MEMORY_H
-#define NEED_MEMORY_H 0
-#endif
#if !NO_ASSERT_H
#include <assert.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
-#if NEED_MEMORY_H
-#include <memory.h>
-#endif
#include "bn.h"
#include "sieve.h"
#define raise(sig) kill(getpid(),sig)
#endif
-/*
- * If there are no prototypes for the stdio functions, to reduce
- * compiler warnings include these... conditional on EOF being
- * defined (a giveaway that <stdio.h> was #included).
- */
-#if defined(EOF)
-
-#if NO_STDIO_PROTOS /* Missing prototypes for "simple" functions */
-int (puts)(char const *);
-int (fputs)(char const *, FILE *);
-void (rewind)(FILE *);
-int (fflush)(FILE *);
-int (fclose)(FILE *);
-int (printf)(char const *, ...);
-int (fprintf)(FILE *, char const *, ...);
-int (fseek)(FILE *, long, int);
-int (remove)(char const *);
-int (rename)(char const *, char const *);
-void (perror)(char const *);
-int (system)(char const *); /* Really in <stdlib.h>, but this'll do... */
-int (pclose)(FILE *);
-/* If we have a sufficiently old-fashioned stdio, it probably uses these... */
-int (_flsbuf)(int, FILE *);
-int (_filbuf)(FILE *);
-int (ungetc)(int, FILE *);
-size_t (fread)(char *, size_t, size_t, FILE *);
-size_t (fwrite)(char const *, size_t, size_t, FILE *);
-#if defined(va_start) || defined(va_arg) || defined(va_end)
-int (vfprintf)(FILE *, char const *, ...);
-#endif
-#endif /* NO_STDIO_PROTOS */
-
-#endif /* EOF */
-
/*
* Make Microsoft Visual C shut the hell up about a few things...
* Warning 4116 complains about the alignof() macro, saying: