summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
commitb7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch)
tree468d9610a590685322ad2159a9bd2d9e2ba83f89 /include
parent7de513f180c429859e246d1033d745b394e1fc28 (diff)
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r--include/m_core.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/include/m_core.h b/include/m_core.h
index c35fb86aa0..4515529b06 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -61,8 +61,6 @@ typedef uint32_t MCONTACT;
typedef uint32_t MEVENT;
-
-
///////////////////////////////////////////////////////////////////////////////
// events, hooks & services
@@ -733,6 +731,35 @@ MIR_CORE_DLL(void) UnloadCoreModule(void);
#if defined(__cplusplus)
}
+
+template <size_t _Size>
+inline int mir_snprintf(char(&buffer)[_Size], const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ return mir_vsnprintf(buffer, _Size, fmt, args);
+}
+
+template <size_t _Size>
+inline int mir_snwprintf(wchar_t(&buffer)[_Size], const wchar_t* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ return mir_vsnwprintf(buffer, _Size, fmt, args);
+}
+
+template <size_t _Size>
+inline int mir_vsnprintf(char(&buffer)[_Size], const char* fmt, va_list va)
+{
+ return mir_vsnprintf(buffer, _Size, fmt, va);
+}
+
+template <size_t _Size>
+inline int mir_vsnwprintf(wchar_t(&buffer)[_Size], const wchar_t* fmt, va_list va)
+{
+ return mir_vsnwprintf(buffer, _Size, fmt, va);
+}
+
#endif
#ifndef MIR_CORE_EXPORTS