On 07/13/15 20:06, Don Lewis wrote:
On 13 Jul, Pedro Giffuni wrote:

On 07/13/15 11:29, Don Lewis wrote:
...
OpenOffice has a clang patch that was not catching this.
I hacked it for FreeBSD now:
http://svn.apache.org/viewvc?view=revision&revision=1690740

But there is certainly something wrong as clang is not being detected.
I think clang defines __GNUC__, so with the existing clang patch we
were still using the original typedef.  If the compiler didn't croak
there, then we would have redefined the typedef again in the __clang__
section.
Yes, clang reports itself as gcc 4.2, so it sets __GNUC__ and
__clang__.

The patch I committed should be a no-op (except for gcc).
<http://stackoverflow.com/questions/28166565/detect-gcc-as-opposed-to-msvc-clang-with-macro>


#if defined(__FreeBSD__) && defined(__GNUC__)
     typedef typeof(SIG_DFL) CoinSighandler_t;
#  define CoinSighandler_t_defined
#endif

//-----------------------------------------------------------------------------

...
<some lines later>
...
//-----------------------------------------------------------------------------

#if defined(__clang__)
     typedef void(*CoinSighandler_t)(int);
#  define CoinSighandler_t_defined
#elif defined(__MACH__) && defined(__GNUC__)
     typedef typeof(SIG_DFL) CoinSighandler_t;
#  define CoinSighandler_t_defined
#endif

Ugh.. the problem is I am only looking at diffs, not at the code so
I missed this mess.

Second try:

http://svn.apache.org/viewvc?view=revision&revision=1690755
This part doesn't look right:

  #if defined(__FreeBSD__) && defined(__GNUC__)
-   typedef __decltype(SIG_DFL) CoinSighandler_t;
+   typedef typeof(SIG_DFL) CoinSighandler_t;
  #  define CoinSighandler_t_defined
  #endif
That's weird, I took the hunk from FreeBSD's port.
patching file CoinMP-1.7.6/Osi/ltmain.sh
patching file CoinMP-1.7.6/CoinUtils/src/CoinSignal.hpp
/usr/local/bin/gpatch: **** malformed patch at line 1230: @@ -95,7 +95,10 @@

dmake:  Error code 2, while making './unxfbsdx.pro/misc/build/so_patched_coinmp'

1 module(s):
        coinmp
need(s) to be rebuilt

Reason(s):


I did notice the buildbot was failing on nss(?).
That's what I get for taking hunks from elsewhere :-P.

As you might have noticed I don't spend much quality time
with AOO lately :-(.


I patched the patch with this patch and got a successful coinmp build:

Index: ext_libraries/coinmp/coinmp-1.7.6-clang.patch
===================================================================
--- ext_libraries/coinmp/coinmp-1.7.6-clang.patch       (revision 1690824)
+++ ext_libraries/coinmp/coinmp-1.7.6-clang.patch       (working copy)
@@ -1,22 +1,25 @@
---- misc/CoinMP-1.7.6/CoinUtils/src/CoinSignal.hpp     2011-01-03 
20:31:00.000000000 -0300
-+++ misc/build/CoinMP-1.7.6/CoinUtils/src/CoinSignal.hpp       2014-02-01 
02:02:10.596696644 -0300
-@@ -44,7 +44,7 @@
+--- misc/CoinMP-1.7.6/CoinUtils/src/CoinSignal.hpp     2011-01-03 
23:31:00.000000000 +0000
++++ misc/build/CoinMP-1.7.6/CoinUtils/src/CoinSignal.hpp       2015-07-14 
00:18:26.105360000 +0000
+@@ -43,7 +43,7 @@
+
   
//-----------------------------------------------------------------------------
- #if defined(__FreeBSD__) && defined(__GNUC__)
--   typedef __decltype(SIG_DFL) CoinSighandler_t;
-+   typedef typeof(SIG_DFL) CoinSighandler_t;
+-#if defined(__FreeBSD__) && defined(__GNUC__)
++#if defined(__FreeBSD__) && defined(__GNUC__) && !defined(__clang__)
+    typedef typeof(SIG_DFL) CoinSighandler_t;
   #  define CoinSighandler_t_defined
   #endif
-@@ -95,7 +95,10 @@
+@@ -100,6 +100,13 @@
+ #  define CoinSighandler_t_defined
+ #endif
- //-----------------------------------------------------------------------------
++//-----------------------------------------------------------------------------
++
++#if defined(__clang__)
++   typedef __decltype(SIG_DFL) CoinSighandler_t;
++#  define CoinSighandler_t_defined
++#endif
++
+ 
//#############################################################################
--#if defined(__MACH__) && defined(__GNUC__)
-+#if !defined(__FreeBSD__) && defined(__clang__)
-+   typedef void(*CoinSighandler_t)(int);
-+#  define CoinSighandler_t_defined
-+#elif defined(__MACH__) && defined(__GNUC__)
-    typedef typeof(SIG_DFL) CoinSighandler_t;
- #  define CoinSighandler_t_defined
- #endif
+ #ifndef CoinSighandler_t_defined


Committed thanks.

Pedro.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to