diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-08-13 22:26:15 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-08-13 22:26:15 +0400 |
commit | 75af1a7f9eba4c761fea08995c5d529ed602a19a (patch) | |
tree | e5d232f3773f8c8496431ebc3e407b4d2b9a0fe7 /source | |
parent | 52a6a07d67f48c6c3465cbaf156bf8057755e1bc (diff) |
MSVC compile fix.
* replaced snprintf with BLI_snprintf
* in unit.c used the #define hack used in several places already to avoid adding additional dependency.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index fde0ac5391d..ba609fc5611 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -27,6 +27,10 @@ #include <string.h> #include <math.h> +#if defined(WIN32) && (!(defined snprintf)) +#define snprintf _snprintf +#endif + #define TEMP_STR_SIZE 256 /* define a single unit */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index ac26fe86364..4f6c6db3b16 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -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); |