Hi,

I am giving cxxtools a try on my Mac and noticed some quirks that needed addressing:

* suseconds_t is not defined on my system (use time_t instead)
* CXXTOOLS_ATOMICITY_GCC_PPC was mis-spelled and not used

Here is a patch that takes care of these things. I've tried to stick to the existing style in the configure script and header files. I double-checked the patch on an up-to-date Debian Linux box, it seems to not interfere with what's there. Hope this helps.

Cheers,
Roland


--
Roland Philippsen
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE84C528D
http://poftwaresatent.net/             skype: poftwaresatent
Index: include/cxxtools/hirestime.h
===================================================================
--- include/cxxtools/hirestime.h        (revision 543)
+++ include/cxxtools/hirestime.h        (working copy)
@@ -25,6 +25,12 @@
 #include <sys/time.h>
 #include <iosfwd>
 
+#include <cxxtools/config.h>
+
+#if defined(CXXTOOLS_SUSECONDS_TIME_T)
+typedef time_t suseconds_t;
+#endif
+
 namespace cxxtools
 {
   class HiresTime
Index: include/cxxtools/atomicity.h
===================================================================
--- include/cxxtools/atomicity.h        (revision 543)
+++ include/cxxtools/atomicity.h        (working copy)
@@ -45,6 +45,9 @@
 #elif defined(CXXTOOLS_ATOMICITY_GCC_X86)
     #include <cxxtools/atomicity.gcc.x86.h>
 
+#elif defined(CXXTOOLS_ATOMICITY_GCC_PPC)
+    #include <cxxtools/atomicity.gcc.ppc.h>
+
 #else
     #include <cxxtools/atomicity.pthread.h>
 
Index: include/cxxtools/config.h.in
===================================================================
--- include/cxxtools/config.h.in        (revision 543)
+++ include/cxxtools/config.h.in        (working copy)
@@ -4,3 +4,6 @@
 
 /** defines, how to implement atomic operations */
 #define @CXXTOOLS_ATOMICITY@
+
+/** defines whether we have suseconds_t on this system */
+#define @CXXTOOLS_SUSECONDS@
Index: configure.in
===================================================================
--- configure.in        (revision 543)
+++ configure.in        (working copy)
@@ -169,8 +169,8 @@
           [#include "include/cxxtools/atomicity.gcc.ppc.h"
            int main() { cxxtools::atomic_t a = 0; 
cxxtools::atomicIncrement(a); }
           ],
-          CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_PCC
-          AC_MSG_RESULT(gcc pcc),
+          CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_PPC
+          AC_MSG_RESULT(gcc ppc),
 
           AC_COMPILE_IFELSE(
             [#include "include/cxxtools/atomicity.gcc.x86_64.h"
@@ -215,6 +215,19 @@
 
 AC_SUBST(CXXTOOLS_ATOMICITY)
 
+#
+# checking existance of suseconds_t, needed by hirestime.h
+#
+AC_CHECKING(for suseconds_t)
+
+AC_CHECK_TYPE(
+  suseconds_t,
+  [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_T],
+  [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_TIME_T],
+  [#include <sys/time.h>])
+
+AC_SUBST(CXXTOOLS_SUSECONDS)
+
 AM_CONDITIONAL(MAKE_ATOMICITY_PTHREAD, test "$atomicity_pthread" = yes)
 
 AC_CONFIG_FILES([cxxtools-config], [chmod +x cxxtools-config])
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to