Author: al
Date: 2009-12-30 21:26:10 +0100 (Wed, 30 Dec 2009)
New Revision: 2905

Modified:
   trunk/librawstudio/rs-image16.c
Log:
Using _aligned_malloc() when compiling in windows.

Modified: trunk/librawstudio/rs-image16.c
===================================================================
--- trunk/librawstudio/rs-image16.c     2009-12-30 20:24:38 UTC (rev 2904)
+++ trunk/librawstudio/rs-image16.c     2009-12-30 20:26:10 UTC (rev 2905)
@@ -17,6 +17,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
  */
 
+#ifdef WIN32 /* Win32 _aligned_malloc */
+#include <malloc.h>
+#include <stdio.h>
+#endif
+
 #include <rawstudio.h>
 #include <gtk/gtk.h>
 #include <string.h>
@@ -802,8 +807,13 @@
        rsi->filters = 0;
 
        /* Allocate actual pixels */
+#ifdef WIN32
+       rsi->pixels = _aligned_malloc(rsi->h*rsi->rowstride * sizeof(gushort), 
16); 
+       if (rsi->pixels == NULL)
+#else
        ret = posix_memalign((void **) &rsi->pixels, 16, rsi->h*rsi->rowstride 
* sizeof(gushort));
        if (ret > 0)
+#endif
        {
                rsi->pixels = NULL;
                g_object_unref(rsi);


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to