OLD | NEW |
---|---|
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <windows.h> | 5 #include <windows.h> |
6 #include <CommCtrl.h> | 6 #include <CommCtrl.h> |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <time.h> | 8 #include <time.h> |
9 #include <windowsx.h> | 9 #include <windowsx.h> |
10 #include <atlbase.h> | 10 #include <atlbase.h> |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
617 } | 617 } |
618 | 618 |
619 void MainUIWindow::AddDebugMessage(const wchar_t* format, ...) { | 619 void MainUIWindow::AddDebugMessage(const wchar_t* format, ...) { |
620 DCHECK(format); | 620 DCHECK(format); |
621 if (!format) | 621 if (!format) |
622 return; | 622 return; |
623 | 623 |
624 const int kMaxDebugBuffSize = 1024; | 624 const int kMaxDebugBuffSize = 1024; |
625 | 625 |
626 va_list arg_list; | 626 va_list arg_list; |
627 #if _MSC_VER >= 1900 | |
628 __crt_va_start(arg_list, format); | |
Reid Kleckner
2015/06/09 00:37:59
Why not va_start from <stdarg.h>?
scottmg
2015/06/09 16:27:43
No idea, it seemed strange enough that I left it a
scottmg
2015/06/09 16:28:28
Hmm, attributed to one "initial.commit" so I'm gue
scottmg
2015/06/09 16:33:47
and va_start is #defined to [_]_crt_va_start (as y
| |
629 #else | |
627 _crt_va_start(arg_list, format); | 630 _crt_va_start(arg_list, format); |
631 #endif | |
628 | 632 |
629 wchar_t text[kMaxDebugBuffSize + 1]; | 633 wchar_t text[kMaxDebugBuffSize + 1]; |
630 vswprintf_s(text, kMaxDebugBuffSize, format, arg_list); | 634 vswprintf_s(text, kMaxDebugBuffSize, format, arg_list); |
631 text[kMaxDebugBuffSize] = L'\0'; | 635 text[kMaxDebugBuffSize] = L'\0'; |
632 | 636 |
633 InsertLineInListView(text); | 637 InsertLineInListView(text); |
634 } | 638 } |
635 | 639 |
636 | 640 |
637 void MainUIWindow::InsertLineInListView(wchar_t* debug_message) { | 641 void MainUIWindow::InsertLineInListView(wchar_t* debug_message) { |
(...skipping 22 matching lines...) Expand all Loading... | |
660 item.iItem = ListView_GetItemCount(list_view_); | 664 item.iItem = ListView_GetItemCount(list_view_); |
661 item.iSubItem = 0; | 665 item.iSubItem = 0; |
662 item.mask = LVIF_TEXT | LVIF_PARAM; | 666 item.mask = LVIF_TEXT | LVIF_PARAM; |
663 item.pszText = message_time; | 667 item.pszText = message_time; |
664 item.lParam = 0; | 668 item.lParam = 0; |
665 | 669 |
666 ListView_InsertItem(list_view_, &item); | 670 ListView_InsertItem(list_view_, &item); |
667 | 671 |
668 delete[] message_time; | 672 delete[] message_time; |
669 } | 673 } |
OLD | NEW |