mkstemp.c: Include gansidecl.h.

* mkstemp.c: Include gansidecl.h.  Rename uint64_t to gcc_uint64_t.
        (mkstemp): Remove size specifier for variable `letters'.  Call
        gettimeofday, not __gettimeofday.

From-SVN: r20752
This commit is contained in:
Kaveh R. Ghazi 1998-06-27 09:37:37 +00:00 committed by Kaveh Ghazi
parent 7b8c3f6860
commit 7f43495a8e
2 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,9 @@
Sat Jun 27 07:35:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mkstemp.c: Include gansidecl.h. Rename uint64_t to gcc_uint64_t.
(mkstemp): Remove size specifier for variable `letters'. Call
gettimeofday, not __gettimeofday.
* Makefile.in (EXPR_H): New dependency variable.
(c-typeck.o): Depend on $(EXPR_H) instead of expr.h.
(c-iterate.o): Likewise.

View File

@ -28,12 +28,13 @@
#else
#include "config.h"
#include "system.h"
#include "gansidecl.h"
/* We need to provide a type for uint64_t. */
/* We need to provide a type for gcc_uint64_t. */
#ifdef __GNUC__
typedef unsigned long long uint64_t;
typedef unsigned long long gcc_uint64_t;
#else
typedef unsigned long uint64_t;
typedef unsigned long gcc_uint64_t;
#endif
#ifndef TMP_MAX
@ -49,9 +50,9 @@ int
mkstemp (template)
char *template;
{
static const char letters[62]
static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
static uint64_t value;
static gcc_uint64_t value;
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
#endif
@ -70,15 +71,15 @@ mkstemp (template)
#ifdef HAVE_GETTIMEOFDAY
/* Get some more or less random data. */
__gettimeofday (&tv, NULL);
value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
gettimeofday (&tv, NULL);
value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
#else
value += getpid ();
#endif
for (count = 0; count < TMP_MAX; ++count)
{
uint64_t v = value;
gcc_uint64_t v = value;
int fd;
/* Fill in the random bits. */