Commit 7f43495a by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 7b8c3f68
Sat Jun 27 07:35:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 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. * Makefile.in (EXPR_H): New dependency variable.
(c-typeck.o): Depend on $(EXPR_H) instead of expr.h. (c-typeck.o): Depend on $(EXPR_H) instead of expr.h.
(c-iterate.o): Likewise. (c-iterate.o): Likewise.
......
...@@ -28,12 +28,13 @@ ...@@ -28,12 +28,13 @@
#else #else
#include "config.h" #include "config.h"
#include "system.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__ #ifdef __GNUC__
typedef unsigned long long uint64_t; typedef unsigned long long gcc_uint64_t;
#else #else
typedef unsigned long uint64_t; typedef unsigned long gcc_uint64_t;
#endif #endif
#ifndef TMP_MAX #ifndef TMP_MAX
...@@ -49,9 +50,9 @@ int ...@@ -49,9 +50,9 @@ int
mkstemp (template) mkstemp (template)
char *template; char *template;
{ {
static const char letters[62] static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
static uint64_t value; static gcc_uint64_t value;
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
struct timeval tv; struct timeval tv;
#endif #endif
...@@ -70,15 +71,15 @@ mkstemp (template) ...@@ -70,15 +71,15 @@ mkstemp (template)
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
/* Get some more or less random data. */ /* Get some more or less random data. */
__gettimeofday (&tv, NULL); gettimeofday (&tv, NULL);
value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
#else #else
value += getpid (); value += getpid ();
#endif #endif
for (count = 0; count < TMP_MAX; ++count) for (count = 0; count < TMP_MAX; ++count)
{ {
uint64_t v = value; gcc_uint64_t v = value;
int fd; int fd;
/* Fill in the random bits. */ /* Fill in the random bits. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment