MSVC compile fix.
authorAndrea Weikert <elubie@gmx.net>
Thu, 13 Aug 2009 18:26:15 +0000 (18:26 +0000)
committerAndrea Weikert <elubie@gmx.net>
Thu, 13 Aug 2009 18:26:15 +0000 (18:26 +0000)
* replaced snprintf with BLI_snprintf
* in unit.c used the #define hack used in several places already to avoid adding additional dependency.

source/blender/blenkernel/intern/unit.c
source/blender/editors/interface/interface.c

index fde0ac5391dda75915ae2221e7191687766de2fa..ba609fc5611a78eb29374e199e6a965e0007c857 100644 (file)
 #include <string.h>
 #include <math.h>
 
+#if defined(WIN32) && (!(defined snprintf))
+#define snprintf _snprintf
+#endif
+
 #define TEMP_STR_SIZE 256
 
 /* define a single unit */
index ac26fe863642f4ca699723b047dc238772d44a3c..4f6c6db3b16a5a46ae0e8c6d73992b3d4d5ebe50 100644 (file)
@@ -1876,7 +1876,7 @@ void ui_check_but(uiBut *but)
                        else if(ui_is_but_unit(but)) {
                                char new_str[sizeof(but->drawstr)];
                                ui_get_but_string_unit(but, new_str, sizeof(new_str), value, TRUE);
-                               snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
+                               BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
                        }
                        else if(but->a2) { /* amount of digits defined */
                                if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);