vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] Build error on 32-bit linux


From: Thomas Dickey
Subject: Re: [vile] Build error on 32-bit linux
Date: Wed, 3 Feb 2010 18:59:36 -0500 (EST)

On Wed, 3 Feb 2010, Thomas Dickey wrote:

On Wed, 3 Feb 2010, Thomas Dickey wrote:

On Wed, 3 Feb 2010, Chris G wrote:

I've just been trying to build vile-9.7zb on my little server box
which is all 32-bit.  I'm compiling exactly the same stuff as built
perfectly OK on my 64-bit desktop and both systems are running a
variety of ubuntu 9.10.

I'm getting the following error on the 32-bit system:-

The configure check for gettimeofday is failing for whatever reason.
That makes the compile fall-through in estruct.h to the default case:

#if (OPT_AUTOCOLOR || OPT_ELAPSED) && !defined(VL_ELAPSED)
#ifdef HAVE_GETTIMEOFDAY
#define VL_ELAPSED struct timeval
#elif SYS_WINNT
/* this is in w32vile.h */
#else
#define VL_ELAPSED time_t
#endif
#endif

...and in random.c, it's ifdef'd without the check for gettimeofday:

#if SYS_UNIX && !SYS_MINGW
#define SECS(tv)        (tv.tv_sec + (tv.tv_usec / 1.0e6))
   VL_ELAPSED tv1;
   gettimeofday(&tv1, 0);
   if (begin)
       *first = tv1;
   result = 1000.0 * (SECS(tv1) - SECS((*first)));

fwiw, it's been like that since late 2008...

It doesn't answer the question of why gettimeofday isn't detected, but
this will make the ifdef's consistent:

diff -u -r1.332 random.c
--- random.c    2009/10/31 13:44:55     1.332
+++ random.c    2010/02/03 23:57:08
@@ -1639,7 +1639,7 @@
 {
     double result;

-#if SYS_UNIX && !SYS_MINGW
+#if defined(HAVE_GETTIMEOFDAY) && (SYS_UNIX && !SYS_MINGW)
 #define        SECS(tv)        (tv.tv_sec + (tv.tv_usec / 1.0e6))
     VL_ELAPSED tv1;
     gettimeofday(&tv1, 0);



gcc -c -I. -I. -DHAVE_CONFIG_H -D_GNU_SOURCE -I/usr/include/ncursesw -D_FILE_OFFSET_BITS=64 -DPROGRAM_NAME=\"vile\" -DVILE_ICON=\"icons/vile\" -DVILE_LIBDIR_PATH=\"'/usr/local/lib/vile'\" -DVILE_STARTUP_PATH=\"'/usr/local/share/vile'\" -g -O2 -DHELP_LOC=\"/usr/local/share/vile\" random.c
random.c: In function ???vl_elapsed???:
random.c:1645: warning: passing argument 1 of ???gettimeofday??? from incompatible pointer type /usr/include/sys/time.h:73: note: expected ???struct timeval * __restrict__??? but argument is of type ???time_t *??? random.c:1648: error: request for member ???tv_sec??? in something not a structure or union random.c:1648: error: request for member ???tv_usec??? in something not a structure or union random.c:1648: error: request for member ???tv_sec??? in something not a structure or union random.c:1648: error: request for member ???tv_usec??? in something not a structure or union
make: *** [random.o] Error 1

It looks as if the 32-bit system has a different header file somewhere
that breaks things, any ideas how to fix?

--
Chris Green



_______________________________________________
vile mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/vile


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]