Fix T49991: reloading librairies doesn't update node groups.
[blender.git] / source / blender / datatoc / datatoc_icon.c
index 82eeb3af9b2fbba062cee04504e3239767764653..92048f32a2863c7896c59ebe776a7da77fd19b4b 100644 (file)
 #include "../blenlib/BLI_sys_types.h"
 
 /* for DIR */
-#ifndef WIN32
+#if !defined(WIN32) || defined(FREEWINDOWS)
 #  include <dirent.h>
 #endif
 
 #include "png.h"
 
+
+/* for Win32 DIR functions */
+#ifdef WIN32
+#  include "../blenlib/BLI_winstuff.h"
+#endif
+
 #ifdef WIN32
 #  define SEP '\\'
 #else
@@ -160,7 +166,8 @@ static bool write_png(const char *name, const unsigned int *pixels,
        /* set the individual row-pointers to point at the correct offsets */
        for (i = 0; i < height; i++) {
                row_pointers[height - 1 - i] = (png_bytep)
-                                              (((unsigned char *)pixels) + (i * width) * bytesperpixel * sizeof(unsigned char));
+                                              (((const unsigned char *)pixels) +
+                                               (i * width) * bytesperpixel * sizeof(unsigned char));
        }
 
        /* write out the entire image data in one call */
@@ -308,6 +315,9 @@ static bool icon_merge(const char *file_src,
 
        free(pixels);
 
+       /* only for bounds check */
+       (void)canvas_h;
+
        return true;
 }