aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2018-03-01 15:11:44 -0500
committerSergio Durigan Junior <sergiodj@redhat.com>2018-03-02 07:32:31 -0500
commitab818ade016bcd794980438775e15c7a74f054f9 (patch)
tree523ab3f5cc051f5e18c2405bd2906905521bcb70
parentecc054c097e7ced281d02ef9632eb0261a410b96 (diff)
downloadbinutils-ab818ade016bcd794980438775e15c7a74f054f9.zip
binutils-ab818ade016bcd794980438775e15c7a74f054f9.tar.gz
binutils-ab818ade016bcd794980438775e15c7a74f054f9.tar.bz2
Conditionally include "<windows.h>" on common/pathstuff.c (and unbreak build on mingw*)
commit b4987c956dfa44ca9fd8552f63e15f5fa094b2a4 Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Fri Feb 9 18:44:59 2018 -0500 Create new common/pathstuff.[ch] Introduced a regression when compiling for mingw*: /gdb/common/pathstuff.c: In function 'gdb::unique_xmalloc_ptr<char> gdb_realpath(const char*)': /gdb/common/pathstuff.c:56:14: error: 'MAX_PATH' was not declared in this scope char buf[MAX_PATH]; ^ /gdb/common/pathstuff.c:57:5: error: 'DWORD' was not declared in this scope DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); ^ /gdb/common/pathstuff.c:57:11: error: expected ';' before 'len' DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); ^ /gdb/common/pathstuff.c:63:9: error: 'len' was not declared in this scope if (len > 0 && len < MAX_PATH) ^ /gdb/common/pathstuff.c:64:54: error: 'buf' was not declared in this scope return gdb::unique_xmalloc_ptr<char> (xstrdup (buf)); ^ make[2]: *** [pathstuff.o] Error 1 The proper fix is to conditionally include "<windows.h>". This commit does that, without introducing any regressions as per tests made by our BuildBot. gdb/ChangeLog: 2018-03-01 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/22907 * common/pathstuff.c: Conditionally include "<windows.h>".
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/common/pathstuff.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5bfbe9b..8d3b633 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-01 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR gdb/22907
+ * common/pathstuff.c: Conditionally include "<windows.h>".
+
2018-03-01 Georg Sauthoff <mail@georg.so>
PR gdb/22888
diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
index fc574dc..8c4093f 100644
--- a/gdb/common/pathstuff.c
+++ b/gdb/common/pathstuff.c
@@ -23,6 +23,10 @@
#include "filenames.h"
#include "gdb_tilde_expand.h"
+#ifdef USE_WIN32API
+#include <windows.h>
+#endif
+
/* See common/pathstuff.h. */
gdb::unique_xmalloc_ptr<char>