diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index f2ca4e5a33a5353df806e1d8a847cf7288d57ba9..d3da4a40559eb51edc577f1fdc89a8113903e659 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -3,6 +3,9 @@
  * definitions into ecpg programs
  */
 
+#ifndef _ECPGLIB_H
+#define _ECPGLIB_H
+
 #include <stdio.h>
 
 #ifndef __BEOS__
@@ -74,3 +77,5 @@ void		ECPGfree_auto_mem(void);
 }
 
 #endif
+
+#endif /* _ECPGLIB_H */
diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h
index 8f640906e46da518920af650617f6a5208b57795..5520ff882f689bd49ad49cc4965c31be8b915e64 100644
--- a/src/interfaces/ecpg/include/ecpgtype.h
+++ b/src/interfaces/ecpg/include/ecpgtype.h
@@ -27,6 +27,10 @@
  * This is a typically recursive definition. A structure of typed list elements
  * would probably work fine:
  */
+
+#ifndef _ECPGTYPE_H
+#define _ECPGTYPE_H
+
 #ifdef __cplusplus
 extern		"C"
 {
@@ -76,5 +80,6 @@ enum ECPGdtype
 
 #ifdef __cplusplus
 }
-
 #endif
+
+#endif /* _ECPGTYPE_H */
diff --git a/src/interfaces/ecpg/lib/extern.h b/src/interfaces/ecpg/lib/extern.h
index 24073bba4ea1317a3eb4cbcd7a072ee72c8e02bc..00a65b94e216749c7edbe87d798d1e83329032dd 100644
--- a/src/interfaces/ecpg/lib/extern.h
+++ b/src/interfaces/ecpg/lib/extern.h
@@ -1,3 +1,6 @@
+#ifndef _ECPG_LIB_EXTERN_H
+#define _ECPG_LIB_EXTERN_H
+
 #include "postgres_fe.h"
 #include "libpq-fe.h"
 
@@ -87,3 +90,5 @@ PGresult  **
 
 bool ECPGstore_result(const PGresult *results, int act_field,
 				 const struct statement * stmt, struct variable * var);
+
+#endif /* _ECPG_LIB_EXTERN_H */
diff --git a/src/interfaces/ecpg/preproc/extern.h b/src/interfaces/ecpg/preproc/extern.h
index 9b90899c09890d43dfc4872ee12d5c751dce8f4b..6e49948ffbe002b45c5d709e5066c6d891e25bbe 100644
--- a/src/interfaces/ecpg/preproc/extern.h
+++ b/src/interfaces/ecpg/preproc/extern.h
@@ -1,3 +1,6 @@
+#ifndef _ECPG_PREPROC_EXTERN_H
+#define _ECPG_PREPROC_EXTERN_H
+
 #include "type.h"
 
 #include <errno.h>
@@ -89,3 +92,5 @@ extern ScanKeyword *ScanKeywordLookup(char *text);
 #define OUT_OF_MEMORY		5
 #define INDICATOR_NOT_STRUCT	6
 #define INDICATOR_NOT_SIMPLE	7
+
+#endif /* _ECPG_PREPROC_EXTERN_H */
diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h
index 10d5fc8f48dabbf4d2924714ecfde9e9e7f4ff4a..fd74a1336df752eb88a7ef7eed5b3d5178753671 100644
--- a/src/interfaces/ecpg/preproc/type.h
+++ b/src/interfaces/ecpg/preproc/type.h
@@ -1,3 +1,6 @@
+#ifndef _ECPG_PREPROC_TYPE_H
+#define _ECPG_PREPROC_TYPE_H
+
 #include "ecpgtype.h"
 
 struct ECPGtype;
@@ -172,3 +175,5 @@ typedef struct ScanKeyword
 	char	   *name;
 	int			value;
 } ScanKeyword;
+
+#endif /* _ECPG_PREPROC_TYPE_H */