Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: base/logging.cc

Issue 613273005: Enable "extern template" under MSVC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/logging.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/logging.h" 5 #include "base/logging.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <io.h> 8 #include <io.h>
9 #include <windows.h> 9 #include <windows.h>
10 typedef HANDLE FileHandle; 10 typedef HANDLE FileHandle;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } 437 }
438 438
439 void SetLogMessageHandler(LogMessageHandlerFunction handler) { 439 void SetLogMessageHandler(LogMessageHandlerFunction handler) {
440 log_message_handler = handler; 440 log_message_handler = handler;
441 } 441 }
442 442
443 LogMessageHandlerFunction GetLogMessageHandler() { 443 LogMessageHandlerFunction GetLogMessageHandler() {
444 return log_message_handler; 444 return log_message_handler;
445 } 445 }
446 446
447 // MSVC doesn't like complex extern templates and DLLs.
448 #if !defined(COMPILER_MSVC)
449 // Explicit instantiations for commonly used comparisons. 447 // Explicit instantiations for commonly used comparisons.
450 template std::string* MakeCheckOpString<int, int>( 448 template std::string* MakeCheckOpString<int, int>(
451 const int&, const int&, const char* names); 449 const int&, const int&, const char* names);
452 template std::string* MakeCheckOpString<unsigned long, unsigned long>( 450 template std::string* MakeCheckOpString<unsigned long, unsigned long>(
453 const unsigned long&, const unsigned long&, const char* names); 451 const unsigned long&, const unsigned long&, const char* names);
454 template std::string* MakeCheckOpString<unsigned long, unsigned int>( 452 template std::string* MakeCheckOpString<unsigned long, unsigned int>(
455 const unsigned long&, const unsigned int&, const char* names); 453 const unsigned long&, const unsigned int&, const char* names);
456 template std::string* MakeCheckOpString<unsigned int, unsigned long>( 454 template std::string* MakeCheckOpString<unsigned int, unsigned long>(
457 const unsigned int&, const unsigned long&, const char* names); 455 const unsigned int&, const unsigned long&, const char* names);
458 template std::string* MakeCheckOpString<std::string, std::string>( 456 template std::string* MakeCheckOpString<std::string, std::string>(
459 const std::string&, const std::string&, const char* name); 457 const std::string&, const std::string&, const char* name);
460 #endif
461 458
462 #if !defined(NDEBUG) 459 #if !defined(NDEBUG)
463 // Displays a message box to the user with the error message in it. 460 // Displays a message box to the user with the error message in it.
464 // Used for fatal messages, where we close the app simultaneously. 461 // Used for fatal messages, where we close the app simultaneously.
465 // This is for developers only; we don't use this in circumstances 462 // This is for developers only; we don't use this in circumstances
466 // (like release builds) where users could see it, since users don't 463 // (like release builds) where users could see it, since users don't
467 // understand these messages anyway. 464 // understand these messages anyway.
468 void DisplayDebugMessageInDialog(const std::string& str) { 465 void DisplayDebugMessageInDialog(const std::string& str) {
469 if (str.empty()) 466 if (str.empty())
470 return; 467 return;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 return *log_file_name; 803 return *log_file_name;
807 return std::wstring(); 804 return std::wstring();
808 } 805 }
809 #endif 806 #endif
810 807
811 } // namespace logging 808 } // namespace logging
812 809
813 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 810 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
814 return out << base::WideToUTF8(std::wstring(wstr)); 811 return out << base::WideToUTF8(std::wstring(wstr));
815 } 812 }
OLDNEW
« no previous file with comments | « base/logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698