changeset 12702:29b7963bf748 octave-forge

define typeof() when missing; support for clang compiler added
author schloegl
date Tue, 22 Dec 2015 10:28:53 +0000
parents 794b03395bbd
children 97f8473c1099
files extra/NaN/src/Makefile extra/NaN/src/covm_mex.cpp extra/NaN/src/sumskipnan_mex.cpp extra/NaN/src/xptopen.cpp
diffstat 4 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extra/NaN/src/Makefile	Tue Dec 22 00:48:47 2015 +0000
+++ b/extra/NaN/src/Makefile	Tue Dec 22 10:28:53 2015 +0000
@@ -48,9 +48,9 @@
 ifneq (Darwin,$(shell uname)) 
 CFLAGS      += -fopenmp 
 MEX_OPTION  += -lgomp 
+MEX_OPTION  += CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS) " CXXFLAGS\#"$(CFLAGS) "
 endif 
  
-MEX_OPTION  += CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS) " CXXFLAGS\#"$(CFLAGS) "
 MATMEX      = $(MATLABDIR)/bin/mex $(MEX_OPTION)
 
 PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex 
--- a/extra/NaN/src/covm_mex.cpp	Tue Dec 22 00:48:47 2015 +0000
+++ b/extra/NaN/src/covm_mex.cpp	Tue Dec 22 10:28:53 2015 +0000
@@ -54,6 +54,10 @@
  */
 #define ISNAN(a) (a!=a)
 
+#ifndef typeof
+#define typeof __typeof__
+#endif
+
 void mexFunction(int POutputCount,  mxArray* POutput[], int PInputCount, const mxArray *PInputs[]) 
 {
     	double 		*X0=NULL, *Y0=NULL, *W=NULL;
--- a/extra/NaN/src/sumskipnan_mex.cpp	Tue Dec 22 00:48:47 2015 +0000
+++ b/extra/NaN/src/sumskipnan_mex.cpp	Tue Dec 22 10:28:53 2015 +0000
@@ -58,6 +58,9 @@
 */
 #define ISNAN(a) (a!=a)
 
+#ifndef typeof
+#define typeof __typeof__
+#endif
 
 inline void __sumskipnan2w__(double *data, size_t Ni, double *s, double *No, char *flag_anyISNAN, double *W);
 inline void __sumskipnan3w__(double *data, size_t Ni, double *s, double *s2, double *No, char *flag_anyISNAN, double *W);
--- a/extra/NaN/src/xptopen.cpp	Tue Dec 22 00:48:47 2015 +0000
+++ b/extra/NaN/src/xptopen.cpp	Tue Dec 22 10:28:53 2015 +0000
@@ -63,6 +63,10 @@
 #include <time.h>
 #include "mex.h"
 
+#ifndef typeof
+#define typeof __typeof__
+#endif
+
 #ifdef tmwtypes_h
   #if (MX_API_VER<=0x07020000)
     typedef int mwSize;