POV-Ray : Newsgroups : povray.beta-test : compile error: 'CLOCK_PROCESS_CPUTIME_ID' was not declared in this scope : Re: compile error: 'CLOCK_PROCESS_CPUTIME_ID' was not declared in thisscope Server Time
11 Aug 2022 20:10:49 EDT (-0400)
  Re: compile error: 'CLOCK_PROCESS_CPUTIME_ID' was not declared in thisscope  
From: marabou
Date: 16 Jul 2009 15:33:38
Message: <4a5f8092@news.povray.org>
On Thu, 16 Jul 2009 10:11:54 +0200 Le_Forgeron wrote:

> Le 15/07/2009 19:40, clipka nous fit lire :
>> Le_Forgeron <jgr### [at] freefr> wrote:
>>> Now, CLOCK_PROCESS_CPUTIME_ID is posix, so should we just hate freebsd
>>> 7.2 and lower for not having it ? (no assertion about 8.0)
>> 
>> Sounds like a reasonable option :P (SCNR)
>> 
>> I'd say it depends on how complicated it would be to fix. At any rate,
>> it's worth entering into the bugtracker as a compatibility issue. As
>> you seem to be into details to some degree, would you mind...? kthxbye
>> ;)
>> 
>> 
>> 
> Entry add in bugtracker, as per request.

Povray does compile now. The patch follows. But there is another problem 
which is ugly:
[..]
Making all in libraries
Making all in source
Making all in backend
Making all in base
Making all in frontend
Making all in vfe
Making all in unix
./unix/povray +i./scenes/advanced/biscuit.pov -f +d +p +v +w320 +h240 
+a0.3 +L./include
povray: this pre-release version of POV-Ray for Unix has expired
*** Error code 1

Stop in /usr/home/user/sources/povray-3.7.0.beta.32.

How can I circumvent it?
Another question:
If Povray executes, how can I check if my patch is successful? Would 
Povray start? Would it crash? Which checks have to be done?
Thank you in advance.

---------------------------------------------------------------
Patch:

--- vfe/unix/platformbase.cpp.old	2009-07-16 21:24:30.000000000 +0200
+++ vfe/unix/platformbase.cpp	2009-07-16 21:18:36.000000000 +0200
@@ -191,7 +191,11 @@ namespace pov_base
 	{
 #ifdef HAVE_CLOCK_GETTIME
 		struct timespec ts;
+#if defined (__FreeBSD__)
+		if (clock_gettime(m_ThreadTimeOnly ? CLOCK_THREAD_CPUTIME_ID : CLOCK_REALTIME, &ts)
== 0)
+#else
 		if (clock_gettime(m_ThreadTimeOnly ? CLOCK_THREAD_CPUTIME_ID :
CLOCK_PROCESS_CPUTIME_ID, &ts) == 0)
+#endif
 			return (unsigned POV_LONG) (1000)*ts.tv_sec + ts.tv_nsec/1000000;
 #endif
 #ifdef HAVE_GETRUSAGE


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.