OSDN Git Service

Change Dir Structure to be same as TortoiseSVN'
[tortoisegit/TortoiseGitJp.git] / src / Utils / DebugHelpers.h
diff --git a/src/Utils/DebugHelpers.h b/src/Utils/DebugHelpers.h
new file mode 100644 (file)
index 0000000..de0b9bc
--- /dev/null
@@ -0,0 +1,57 @@
+// TortoiseSVN - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2003-2006 - Stefan Kueng\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#pragma once\r
+\r
+#ifdef _DEBUG\r
+#      define BEGIN_TICK   { DWORD dwTickMeasureBegin = ::GetTickCount();\r
+#      define END_TICK(s) DWORD dwTickMeasureEnd = ::GetTickCount(); TRACE("%s: tick count = %d\n", s, dwTickMeasureEnd-dwTickMeasureBegin); }\r
+#else\r
+#      define BEGIN_TICK\r
+#      define END_TICK(s)\r
+#endif\r
+\r
+/**\r
+ * \ingroup CommonClasses\r
+ * returns the string to the given error number.\r
+ * \param err the error number, obtained with GetLastError() or WSAGetLastError() or ...\r
+ */\r
+CString GetLastErrorMessageString(int err);\r
+/*\r
+ * \ingroup CommonClasses\r
+ * returns the string to the GetLastError() function.\r
+ */\r
+CString GetLastErrorMessageString();\r
+\r
+#define MS_VC_EXCEPTION 0x406d1388\r
+\r
+typedef struct tagTHREADNAME_INFO\r
+{\r
+       DWORD dwType;        // must be 0x1000\r
+       LPCSTR szName;       // pointer to name (in same addr space)\r
+       DWORD dwThreadID;    // thread ID (-1 caller thread)\r
+       DWORD dwFlags;       // reserved for future use, most be zero\r
+} THREADNAME_INFO;\r
+\r
+/**\r
+ * Sets a name for a thread. The Thread name must not exceed 9 characters!\r
+ * Inside the current thread you can use -1 for dwThreadID.\r
+ * \param dwThreadID The Thread ID\r
+ * \param szThreadName A name for the thread.\r
+ */   \r
+void SetThreadName(DWORD dwThreadID, LPCTSTR szThreadName);\r