patch for octave's mex.h - fix compiling mex files

Alois Schloegl alois.schloegl@ist.ac.at
Mon Jan 13 11:18:00 GMT 2014



When trying to compile the mex-files of the Octave packages NaN-toolbox
and biosig, the error below is observed with the recent version of
octave in Cygwin,

According to

http://octave.1599824.n4.nabble.com/Problems-with-mkoctfile-using-GCC-4-8-1-td4657964.html

http://hg.savannah.gnu.org/hgweb/octave/file/811019b9ef57/libinterp/corefcn/mex.h#l67

the attached patch fixes this for Octave 3.6.4. I suggest to apply this
patch to Octave in Cygwin.


Cheers,
   Alois




schloegl@WT7 /cygdrive/l/src/octave-forge/extra/NaN/src
$ mkoctfile --mex xptopen.cpp
In file included from /usr/include/octave-3.6.4/octave/mexproto.h:52:0,
                 from /usr/include/octave-3.6.4/octave/mex.h:77,
                 from xptopen.cpp:64:
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib: In function
‘long long int std::abs(long long int)’:
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:174:20: error:
declaration of C function ‘long long int std::abs(long long int)’
conflicts with
   abs(long long __x) { return __builtin_llabs (__x); }
                    ^
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:166:3: error:
previous declaration ‘long int std::abs(long int)’ here
   abs(long __i) { return __builtin_labs(__i); }
   ^
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib: In function
‘__int128 std::abs(__int128)’:
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:179:19: error:
declaration of C function ‘__int128 std::abs(__int128)’ conflicts with
   abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
                   ^
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:174:3: error:
previous declaration ‘long long int std::abs(long long int)’ here
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:179:19: error:
declaration of C function ‘__int128 std::abs(__int128)’ conflicts with
   abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
                   ^
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cstdlib:166:3: error:
previous declaration ‘long int std::abs(long int)’ here
   abs(long __i) { return __builtin_labs(__i); }
   ^


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin_octave364.patch
Type: text/x-patch
Size: 523 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140113/60229ba0/attachment.bin>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list