Skip to content

Commit

Permalink
Use old style swprintf with mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperhh committed Jun 20, 2014
1 parent 885d974 commit d693bd9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
@@ -1,5 +1,5 @@
add_library(hidapi
STATIC
STATIC
hidapi/hidapi/hidapi.h
hidapi/windows/hid.c
)
Expand Down
9 changes: 9 additions & 0 deletions src/notifyicon.cpp
Expand Up @@ -27,8 +27,13 @@ NotifyIcon::NotifyIcon(HINSTANCE hInstance, HWND hWnd)
notifyIconData.uVersion = NOTIFYICON_VERSION;
notifyIconData.dwInfoFlags = NIIF_INFO;

#ifdef __MINGW32__
::swprintf(notifyIconData.szTip, _T("WinK760"));
::swprintf(notifyIconData.szInfoTitle, _T("WinK760"));
#else
::swprintf(notifyIconData.szTip, 128, _T("WinK760"));
::swprintf(notifyIconData.szInfoTitle, 64, _T("WinK760"));
#endif // !LIM_SMALL

Shell_NotifyIcon(NIM_ADD, &notifyIconData);
}
Expand All @@ -42,6 +47,10 @@ NotifyIcon::~NotifyIcon(void)
void NotifyIcon::Balloon(const TCHAR* info)
{
notifyIconData.uFlags |= NIF_INFO;
#ifdef __MINGW32__
::swprintf(notifyIconData.szInfo, info);
#else
::swprintf(notifyIconData.szInfo, 256, info);
#endif // !LIM_SMALL
Shell_NotifyIcon(NIM_MODIFY, &notifyIconData);
}

0 comments on commit d693bd9

Please sign in to comment.