Index: soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc2.h
===================================================================
--- soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc2.h	(revision 772)
+++ soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc2.h	(revision 821)
@@ -16,12 +16,5 @@
 #define __NRALLOC2_H__
 
-#ifdef __cplusplus
-#pragma message ("C++")
-extern "C" {
-#endif
-    
-#ifdef VERBOSE_PRAGMA
-//#pragma message ("- *** include nralloc2.h ***")
-#endif
+#include "nrc_os_config.h"
 
 /*
@@ -31,74 +24,111 @@
  */
 
-IMAGE_EXPORT(sint8**)     si8matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint8**)     ui8matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint16**)   si16matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint16**)   ui16matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint32**)   si32matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint32**)   ui32matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint64**)   si64matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint64**)   ui64matrix(long nrl, long nrh, long ncl, long nch);
 
-IMAGE_EXPORT(float32**)   f32matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(float64**)   f64matrix(long nrl, long nrh, long ncl, long nch);
+#undef type_matrix
+#define type_matrix(t) \
+t ** short_name(t,,matrix)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
 
-IMAGE_EXPORT(complex32**) c32matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(complex64**) c64matrix(long nrl, long nrh, long ncl, long nch);
 
-IMAGE_EXPORT(rgb8**)     rgb8matrix(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(rgbx8**)   rgbx8matrix(long nrl, long nrh, long ncl, long nch);
-//IMAGE_EXPORT(rgb32**)   rgb32matrix(long nrl, long nrh, long ncl, long nch);
-//IMAGE_EXPORT(rgbx32**) rgbx32matrix(long nrl, long nrh, long ncl, long nch);
+type_matrix(int8_t);
+type_matrix(uint8_t);
+type_matrix(int16_t);
+type_matrix(uint16_t);
+type_matrix(int32_t);
+type_matrix(uint32_t);
+type_matrix(int64_t);
+type_matrix(uint64_t);
+type_matrix(float);
+type_matrix(double);
+type_matrix(void_p);
+type_matrix(rgb8);
+type_matrix(rgbx8);
+type_matrix(rgb32);
+type_matrix(rgbx32);
+type_matrix(complex32);
+type_matrix(complex64);
 
-/*
- * ---------------
- * --- matrix0 ---
- * ---------------
- */
 
-IMAGE_EXPORT(sint8**)     si8matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint8**)     ui8matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint16**)   si16matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint16**)   ui16matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint32**)    i32matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint32**)   ui32matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(sint64**)   si64matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(uint64**)   ui64matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(rgb8**)     rgb8matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(rgbx8**)   rgbx8matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(rgb32**)   rgb32matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(rgbx32**) rgbx32matrix0(long nrl, long nrh, long ncl, long nch);
+#undef type_matrix0
+#define type_matrix0(t) \
+t ** short_name(t,,matrix0)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
 
-IMAGE_EXPORT(float32**)   f32matrix0(long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(float64**)   f64matrix0(long nrl, long nrh, long ncl, long nch);
 
-/*
- * -------------------
- * --- free_matrix ---
- * -------------------
- */ 
+type_matrix0(int8_t);
+type_matrix0(uint8_t);
+type_matrix0(int16_t);
+type_matrix0(uint16_t);
+type_matrix0(int32_t);
+type_matrix0(uint32_t);
+type_matrix0(int64_t);
+type_matrix0(uint64_t);
+type_matrix0(float);
+type_matrix0(double);
+type_matrix0(void_p);
+type_matrix0(rgb8);
+type_matrix0(rgbx8);
+type_matrix0(rgb32);
+type_matrix0(rgbx32);
+type_matrix0(complex32);
+type_matrix0(complex64);
 
-IMAGE_EXPORT(void) free_si8matrix  (sint8  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_ui8matrix  (uint8  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_si16matrix (sint16 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_ui16matrix (uint16 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_si32matrix (sint32 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_ui32matrix (uint32 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_si64matrix (sint64 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_ui64matrix (uint64 **m, long nrl, long nrh, long ncl, long nch);
 
-IMAGE_EXPORT(void) free_f32matrix (float32   **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_f64matrix (float64   **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_c32matrix (complex32 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_c64matrix (complex64 **m, long nrl, long nrh, long ncl, long nch);
+#if TARGET_OS == GIETVM
 
-IMAGE_EXPORT(void) free_rgb8matrix  (rgb8   **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_rgbx8matrix (rgbx8  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_rgb32matrix (rgb32  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) free_rgbx32matrix(rgbx32 **m, long nrl, long nrh, long ncl, long nch);
+#undef remote_type_matrix
+#define remote_type_matrix(t) \
+t ** short_name(t,remote_,matrix)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
 
-#ifdef __cplusplus
-}
+remote_type_matrix(int8_t);
+remote_type_matrix(uint8_t);
+remote_type_matrix(int16_t);
+remote_type_matrix(uint16_t);
+remote_type_matrix(int32_t);
+remote_type_matrix(uint32_t);
+remote_type_matrix(int64_t);
+remote_type_matrix(uint64_t);
+remote_type_matrix(float);
+remote_type_matrix(double);
+remote_type_matrix(void_p);
+remote_type_matrix(rgb8);
+remote_type_matrix(rgbx8);
+remote_type_matrix(rgb32);
+remote_type_matrix(rgbx32);
+remote_type_matrix(complex32);
+remote_type_matrix(complex64);
+
 #endif
 
+
+#undef free_type_matrix
+#define free_type_matrix(t) \
+void short_name(t,free_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
+
+free_type_matrix(int8_t);
+free_type_matrix(uint8_t);
+free_type_matrix(int16_t);
+free_type_matrix(uint16_t);
+free_type_matrix(int32_t);
+free_type_matrix(uint32_t);
+free_type_matrix(int64_t);
+free_type_matrix(uint64_t);
+free_type_matrix(float);
+free_type_matrix(double);
+free_type_matrix(void_p);
+free_type_matrix(rgb8);
+free_type_matrix(rgbx8);
+free_type_matrix(rgb32);
+free_type_matrix(rgbx32);
+free_type_matrix(complex32);
+free_type_matrix(complex64);
+
+
 #endif /* __NRALLOC2_H__ */
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
