Issue 3482 - CLK_TCK undefined while building with gcc-3.0.4
Summary: CLK_TCK undefined while building with gcc-3.0.4
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: 641
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Unknown
QA Contact: issues@tools
URL:
Keywords:
: 3398 6243 (view as issue list)
Depends on:
Blocks:
 
Reported: 2002-03-14 10:25 UTC by gbeauche
Modified: 2003-03-16 20:14 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch against OOo 641c for CLK_TCK definition & gcc3 builds (692 bytes, patch)
2002-03-19 12:10 UTC, gbeauche
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description gbeauche 2002-03-14 10:25:41 UTC
Hi,

While building OOo 641c for Mandrake Linux 8.2, I hit an undefined CLK_TCK macro
when compiling with gcc-3.0.4 and STLport 4.5.3. Replacing CLK_TCK (obsolete)
with CLOCKS_PER_SEC is of no use. Indeed, they happen to *not* have the same
value. As a consequence, the setup windows refreshing is quite irregular and
everything _looks_ frozen.

The following patch works for me modulo inclusion of <unistd.h> for LINUX
targets. Your mileage may vary.

--- oo_641c_src/tools/source/datetime/ttime.cxx.gcc3	Mon Jun 11 19:17:46 2001
+++ oo_641c_src/tools/source/datetime/ttime.cxx	Thu Feb 21 19:44:52 2002
@@ -73,7 +73,7 @@
 #include <dos.h>
 #elif defined UNX
 #include <limits.h>
-#ifdef IRIX
+#if defined( IRIX ) || defined( UNX )
 #include <unistd.h>
 #endif
 #include <sys/times.h>
@@ -493,7 +493,13 @@
 
 	if ( !nImplTicksPerSecond )
 	{
+#if defined( CLK_TCK )
 
	nImplTicksPerSecond = CLK_TCK;
+#elif defined( _SC_CLK_TCK )
+
	nImplTicksPerSecond = sysconf(_SC_CLK_TCK);
+#else
+#error "I don't know how to get CLK_TCK, you lose."
+#endif
 
	dImplTicksPerSecond = nImplTicksPerSecond;
 
	dImplTicksULONGMAX	= (double)(ULONG)ULONG_MAX;
 	}


Bye,
Gwenole.
Comment 1 oldfield 2002-03-18 01:39:42 UTC
*** Issue 3398 has been marked as a duplicate of this issue. ***
Comment 2 Unknown 2002-03-19 11:37:08 UTC
please use the attachment tool in IssueZilla to submit patches (copy
and 
paste from here creates nasty tabs)

Comment 3 gbeauche 2002-03-19 12:10:34 UTC
Created attachment 1247 [details]
Patch against OOo 641c for CLK_TCK definition & gcc3 builds
Comment 4 Unknown 2002-03-19 13:40:39 UTC
Hi, 

sorry, I did not wanted to be nitpicking... The patch is in 
on OO641C anyway and will be merged later. 

a.
Comment 5 hjs 2002-07-09 13:21:19 UTC
*** Issue 6243 has been marked as a duplicate of this issue. ***
Comment 6 michael.bemmer 2003-03-16 20:10:57 UTC
As discussed with Armin, he thought these bug were closed, he sees all of them
as verified.
Comment 7 michael.bemmer 2003-03-16 20:14:37 UTC
As discussed with Armin, he thought these bug were closed, he sees all of them
as verified.