Title: [106595] trunk/Source/_javascript_Core
- Revision
- 106595
- Author
- [email protected]
- Date
- 2012-02-02 15:03:45 -0800 (Thu, 02 Feb 2012)
Log Message
[GTK] Implement current executable path finding for win32
https://bugs.webkit.org/show_bug.cgi?id=77677
Patch by Kalev Lember <[email protected]> on 2012-02-02
Reviewed by Martin Robinson.
The WTF helper for getting the binary path that was added in r101710
left out the win32 implementation. Fix this.
* wtf/gobject/GlibUtilities.cpp:
(getCurrentExecutablePath):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (106594 => 106595)
--- trunk/Source/_javascript_Core/ChangeLog 2012-02-02 22:55:12 UTC (rev 106594)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-02-02 23:03:45 UTC (rev 106595)
@@ -1,3 +1,16 @@
+2012-02-02 Kalev Lember <[email protected]>
+
+ [GTK] Implement current executable path finding for win32
+ https://bugs.webkit.org/show_bug.cgi?id=77677
+
+ Reviewed by Martin Robinson.
+
+ The WTF helper for getting the binary path that was added in r101710
+ left out the win32 implementation. Fix this.
+
+ * wtf/gobject/GlibUtilities.cpp:
+ (getCurrentExecutablePath):
+
2012-02-02 Filip Pizlo <[email protected]>
Throwing away bytecode and then reparsing during DFG optimization is just
Modified: trunk/Source/_javascript_Core/wtf/gobject/GlibUtilities.cpp (106594 => 106595)
--- trunk/Source/_javascript_Core/wtf/gobject/GlibUtilities.cpp 2012-02-02 22:55:12 UTC (rev 106594)
+++ trunk/Source/_javascript_Core/wtf/gobject/GlibUtilities.cpp 2012-02-02 23:03:45 UTC (rev 106595)
@@ -20,8 +20,13 @@
#include "config.h"
#include "GlibUtilities.h"
+#if OS(WINDOWS)
+#include <windows.h>
+#include <wtf/text/WTFString.h>
+#else
#include <limits.h>
#include <unistd.h>
+#endif
#if OS(LINUX)
CString getCurrentExecutablePath()
@@ -41,4 +46,15 @@
return CString();
return CString(readLinkBuffer, result);
}
+#elif OS(WINDOWS)
+CString getCurrentExecutablePath()
+{
+ static WCHAR buffer[MAX_PATH];
+ DWORD length = GetModuleFileNameW(0, buffer, MAX_PATH);
+ if (!length || (length == MAX_PATH && GetLastError() == ERROR_INSUFFICIENT_BUFFER))
+ return CString();
+
+ String path(buffer, length);
+ return path.utf8();
+}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes