diff --git a/include/my_global.h b/include/my_global.h
index bf6f3b52c4b23295033ff61e1677d1c160671916..865078927fb1d1b610ce4b0ba974455919f64f6f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -43,6 +43,11 @@
 #define HAVE_ERRNO_AS_DEFINE
 #endif /* __CYGWIN__ */
 
+/* Determine when to use "#pragma interface" */
+#if !defined(__CYGWIN__) && !defined(__ICC) && (__GNUC__ < 3)
+#define USE_PRAGMA_INTERFACE
+#endif
+
 #if defined(i386) && !defined(__i386__)
 #define __i386__
 #endif
diff --git a/include/raid.h b/include/raid.h
index 04c54393e54d20ab2d023f4e13179d9b10e3f4c2..c840afcbaabad99c3247db7534ff154c78a298f4 100644
--- a/include/raid.h
+++ b/include/raid.h
@@ -89,7 +89,7 @@ extern "C" {
 #ifdef __cplusplus
 }
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h
index 855d756368db66ceea3b2976d486fc0a2d6cc10e..7ab463b6661cfa9dae5c6bdc244819d845783830 100644
--- a/sql/examples/ha_archive.h
+++ b/sql/examples/ha_archive.h
@@ -14,7 +14,7 @@
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h
index 3c6ce4220ee6fda8404fa7613f5f6585516f580f..ae72e5bb27521e1c039483f8fb1fe4ce772e4046 100644
--- a/sql/examples/ha_example.h
+++ b/sql/examples/ha_example.h
@@ -21,7 +21,7 @@
   that you can implement.
 */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/field.h b/sql/field.h
index f19771c3f9c44fb35741092a41b0c84d31718bd8..1d7669d540d4f82bfbaa0f73ea0725597330a47d 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -20,7 +20,7 @@
   variables must declare the size_of() member function.
 */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index 25d3e1285020cafd7cf3b0227060b150fc901cd7..1d4823bbdc0f66559b7e5622b0a5c7ebb1dad364 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_blackhole.h b/sql/ha_blackhole.h
index b6f924e94b9c37d0f94dfe56819673816744ab56..84a386e17f861892d2b77e716131955f4ef01a04 100644
--- a/sql/ha_blackhole.h
+++ b/sql/ha_blackhole.h
@@ -14,7 +14,7 @@
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_heap.h b/sql/ha_heap.h
index f36e9f31c550c90a108f06a1d4bd8ab9168976ea..60e2e84c5d2975646134bcade20ad0369e0a76e1 100644
--- a/sql/ha_heap.h
+++ b/sql/ha_heap.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index edf428669d8bd27477e3b45df293a00fb3448503..d336811a1ebdf00b5cca1989dc8c681e4369bdcd 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -21,7 +21,7 @@
   Innodb
 */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_isam.h b/sql/ha_isam.h
index b3e932696cb39be369e59263ad7190262e3802ae..1f9b8eb28fe1efb39561e3b91d46ddfe1a826885 100644
--- a/sql/ha_isam.h
+++ b/sql/ha_isam.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h
index 657e506027225f2a4f66420029cd0e9bf7388e6a..82a2e312ca313492802450085f5e9f4d94a2e47e 100644
--- a/sql/ha_isammrg.h
+++ b/sql/ha_isammrg.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index 1e6cf2f4ada4dcc28995e1a052d276fee2cb68ef..b256d4777f9c0d9d937157a4f5623c376badd62f 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h
index 6058c32c8052a4e7bd197531ccfb3da1e4ac97c1..3bc9c11d4be12631267e704aae525b4ab3f95c54 100644
--- a/sql/ha_myisammrg.h
+++ b/sql/ha_myisammrg.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 7de5dd503e7268cbd765ec1d13fc77aa6dcc4b7b..439b485514730509d0763f35c7685cf2d4d61898 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -21,7 +21,7 @@
 
 /* The class defining a handle to an NDB Cluster table */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface                       /* gcc class implementation */
 #endif
 
diff --git a/sql/handler.h b/sql/handler.h
index d2f77c4149a57178592fb7038e7eb152b883609e..df623afcd7955984bb99556a97f38235efe7b5e3 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -17,7 +17,7 @@
 
 /* Definitions for parameters to do with handler-routines */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item.h b/sql/item.h
index d576fbbc60a01793bfe94803ecbbdfe3262693d0..cbb65857027cff3c6c20375db265fe3f69b821de 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 37b0674a094cd65ed7bea59e2855b9fb808011fb..bea8250de9d847dd9a04e4656cf9899037779ffb 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -17,7 +17,7 @@
 
 /* compare and test functions */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_func.h b/sql/item_func.h
index 288db3a148c7f365b1bdecdf1b6b029e41968a22..398efa837bdf919aae907af01dec47a584b167f8 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -17,7 +17,7 @@
 
 /* Function items used by mysql */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 79e4f804a04b0f0ff309367ef268d89e97c2bca9..5f060416ff311edb9f42d433336c16d76548bf64 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -19,7 +19,7 @@
 
 #ifdef HAVE_SPATIAL
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 323b52b826c1c5ae5d087828d7a2246dc8fdfc01..e576b2c2a7e04590f431f2867a93179792f2ede0 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -17,7 +17,8 @@
 
 /* This file defines all string functions */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
+#error PRAGMA
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index a6e005d5d2670f21c35821665373bc9db54c0984..20ba838e61c39810fcc2f81e6e20b3e35b21963a 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -16,7 +16,7 @@
 
 /* subselect Item */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_sum.h b/sql/item_sum.h
index dab136e47164752cd2fd54cefa4146660143acdc..22f577126948b559f4878e1fa1958d600c4750ea 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -17,7 +17,7 @@
 
 /* classes for sum functions */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index cc2709bf5552fcc4bfe59287f47aa578fdcc2ed1..1a30b24b7ce35b7526a407c8bb6504940ec4f4de 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -17,7 +17,7 @@
 
 /* Function items used by mysql */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 5a2044a59f4500a7ac5a4aee1a07d94088808c2e..edecdcc6282b2fc24bda469042136781232fc8bc 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -20,7 +20,7 @@
 #ifndef _opt_range_h
 #define _opt_range_h
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/procedure.h b/sql/procedure.h
index abe50bdc0a0ac271f6bee1ce264e6e3a535ff4fc..0a1e9ddfa2f61974f98fbd3dbb1f499fd6521a91 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -17,7 +17,7 @@
 
 /* When using sql procedures */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface				/* gcc class implementation */
 #endif
 
diff --git a/sql/protocol.h b/sql/protocol.h
index a3b6da55da344e6252dfb51c5943e27fd48e84de..32d6acccddfdd129cbc800e85798550fa6b52b88 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -14,7 +14,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/set_var.h b/sql/set_var.h
index 080a2a95ae0920148cd8b889726ad858258d8409..d452ba03367f7c7de84e20b402e7f76bf1cb5097 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -16,7 +16,7 @@
 
 /* Classes to support the SET command */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 703bb030ab9b7695b1571b8e29d443bddb5efcf8..fbd60373498fd585b184d7fa5274270e190335a8 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -17,7 +17,7 @@
 
 /* Classes in mysql */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/sql_list.h b/sql/sql_list.h
index be3e29b0c6270aae1a2bf75b43e012449c331dd4..45a6b5066eb3192c83c1b3be2b6308b55d21644c 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/sql_select.h b/sql/sql_select.h
index caf4574fbecee077cb0568bcf2ab9e641bb17af7..7e69eca46839e46c91ed771542f925ccd92c6e97 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -17,7 +17,7 @@
 
 /* classes to use when handling where clause */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 8dff5558120dae456a8c2a58ef6b54363b69a90a..31cdd6efb8abec72b38b832a435e56ef96d1d31e 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -16,7 +16,7 @@
 
 /* This file is originally from the mysql distribution. Coded by monty */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class implementation */
 #endif
 
diff --git a/sql/sql_udf.h b/sql/sql_udf.h
index d1f99a6d2329f45c6688f2dcc69c089bbf34d43f..54d2267cac596f8d4761d11bc78d5a7dc4e129df 100644
--- a/sql/sql_udf.h
+++ b/sql/sql_udf.h
@@ -17,7 +17,7 @@
 
 /* This file defines structures needed by udf functions */
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface
 #endif
 
diff --git a/sql/tztime.h b/sql/tztime.h
index 2214c1b29d6d1a7345805285d0f340a851ac3649..e1ff71b6703343bfbaffe1d9e83711c7cecef73d 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -15,7 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
 #pragma interface			/* gcc class interface */
 #endif