]> rtime.felk.cvut.cz Git - mf624-simulink.git/commitdiff
Use correct header file for alloca for Linux build. master
authorKvetoslav Belda <belda@utia.cas.cz>
Fri, 18 Apr 2014 14:20:27 +0000 (16:20 +0200)
committerKvetoslav Belda <belda@utia.cas.cz>
Fri, 18 Apr 2014 14:20:27 +0000 (16:20 +0200)
sfAnalogInput.c

index fdc1722faf1f40b70c8040d92c43b3d473008f19..69572f5f7ae70a31d52442e3c657c064c1286d7f 100644 (file)
 #include "simstruc.h"
 
 #include <stdint.h>
-#include <malloc.h>
 
 #ifndef WITHOUT_HW
 #include "mf624_SIMULINK.h"
 #endif /*WITHOUT_HW*/
 
-  #ifdef __GNUC__
-    #define my_popcount __builtin_popcount
-  #else
-    int my_popcount(uint32_t patt)
-    {
-       int pops = 0;
-       while (patt) {
-          if (patt & 1)
-              pops++;
-          patt >>= 1;
-       }
-       return pops;
+#ifdef __GNUC__
+  #include <alloca.h>
+  #define my_popcount __builtin_popcount
+#else
+  #include <malloc.h>
+  int my_popcount(uint32_t patt)
+  {
+    int pops = 0;
+    while (patt) {
+      if (patt & 1)
+        pops++;
+      patt >>= 1;
     }
-  #endif
+    return pops;
+  }
+#endif
 
 
 /* Error handling