Branch: Tag:

2016-02-22

2016-02-22 16:41:10 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Build [Solaris]: Workaround for broken typedefs on old Solaris.

<sys/types.h> on Solaris 8 believes that GCC doesn't support
long long, and falls back longlong_t to a non-scalar type.
longlong_t is then used to define hrtime_t.

Fixes compilation errors in threads.c:check_threads().

1356:    return num_pike_threads;   }    + #ifdef HAVE_GETHRTIME + /* Workaround for old Solaris, which believes that eg GCC +  * doesn't support long long, which in turn causes hrtime_t +  * to become a non-scalar type. +  */ + union pike_hrtime { +  INT64 val; +  hrtime_t hrt; + }; + #endif +    static void check_threads(struct callback *UNUSED(cb), void *UNUSED(arg), void *UNUSED(arg2))   {   #ifdef PROFILE_CHECK_THREADS
1524: Inside #if defined(HAVE_GETHRTIME)
     #ifdef HAVE_GETHRTIME    { -  static hrtime_t last_ = 0; -  hrtime_t now = gethrtime(); -  if( now-last_ < 50000000 ) /* 0.05s slice */ +  static union pike_hrtime last_ = 0; +  union pike_hrtime now; +  now.hrt = gethrtime(); +  if( now.val-last_.val < 50000000 ) /* 0.05s slice */    return; -  last_ = now; +  last_.val = now.val;    }   #elif defined(HAVE_MACH_TASK_INFO_H) && defined(TASK_THREAD_TIMES_INFO)    {