diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2ab94a2cc22a3a49ec1dfe2f95686cac5b5ce6d0..589afe766314067621c25ec05c42a19e389b8282 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* getopt.c: Include ansidecl.h before system headers.
+
 2005-07-22  Ben Elliston  <bje@gnu.org>
 
 	* getopt.c: Include "ansidecl.h".
diff --git a/libiberty/getopt.c b/libiberty/getopt.c
index 848c183f34f74099a577b463082d09381622b54b..d9c3532ce1136b41ff027439ce7ee6067a7c8673 100644
--- a/libiberty/getopt.c
+++ b/libiberty/getopt.c
@@ -42,8 +42,8 @@
 # endif
 #endif
 
-#include <stdio.h>
 #include "ansidecl.h"
+#include <stdio.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C