From 14f355c2b5c71fc7c3d680aea366582d2ac60f7b Mon Sep 17 00:00:00 2001
From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= <vslavik@fastmail.fm>
Date: Sat, 9 Aug 2003 12:46:53 +0000
Subject: [PATCH] added support for gcc precompiled headers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/common/accesscmn.cpp     | 2 +-
 src/common/appcmn.cpp        | 2 +-
 src/common/artprov.cpp       | 2 +-
 src/common/bmpbase.cpp       | 2 +-
 src/common/choiccmn.cpp      | 2 +-
 src/common/clipcmn.cpp       | 2 +-
 src/common/clntdata.cpp      | 2 +-
 src/common/cmdline.cpp       | 2 +-
 src/common/cmdproc.cpp       | 2 +-
 src/common/cmndata.cpp       | 2 +-
 src/common/config.cpp        | 2 +-
 src/common/containr.cpp      | 2 +-
 src/common/cshelp.cpp        | 2 +-
 src/common/ctrlcmn.cpp       | 2 +-
 src/common/ctrlsub.cpp       | 2 +-
 src/common/datetime.cpp      | 2 +-
 src/common/datstrm.cpp       | 2 +-
 src/common/db.cpp            | 2 +-
 src/common/dbgrid.cpp        | 2 +-
 src/common/dbtable.cpp       | 2 +-
 src/common/dcbase.cpp        | 2 +-
 src/common/dircmn.cpp        | 2 +-
 src/common/dlgcmn.cpp        | 2 +-
 src/common/dndcmn.cpp        | 2 +-
 src/common/dobjcmn.cpp       | 2 +-
 src/common/docmdi.cpp        | 2 +-
 src/common/docview.cpp       | 2 +-
 src/common/dpycmn.cpp        | 2 +-
 src/common/dseldlg.cpp       | 2 +-
 src/common/dynarray.cpp      | 2 +-
 src/common/dynlib.cpp        | 2 +-
 src/common/dynload.cpp       | 2 +-
 src/common/effects.cpp       | 2 +-
 src/common/encconv.cpp       | 2 +-
 src/common/event.cpp         | 2 +-
 src/common/fddlgcmn.cpp      | 2 +-
 src/common/ffile.cpp         | 2 +-
 src/common/file.cpp          | 2 +-
 src/common/fileconf.cpp      | 2 +-
 src/common/filefn.cpp        | 2 +-
 src/common/filename.cpp      | 2 +-
 src/common/filesys.cpp       | 2 +-
 src/common/fldlgcmn.cpp      | 2 +-
 src/common/fontcmn.cpp       | 2 +-
 src/common/fontmap.cpp       | 2 +-
 src/common/framecmn.cpp      | 2 +-
 src/common/fs_inet.cpp       | 2 +-
 src/common/fs_mem.cpp        | 2 +-
 src/common/fs_zip.cpp        | 2 +-
 src/common/ftp.cpp           | 2 +-
 src/common/gaugecmn.cpp      | 2 +-
 src/common/gdicmn.cpp        | 2 +-
 src/common/geometry.cpp      | 2 +-
 src/common/gifdecod.cpp      | 2 +-
 src/common/hash.cpp          | 2 +-
 src/common/hashmap.cpp       | 2 +-
 src/common/helpbase.cpp      | 2 +-
 src/common/http.cpp          | 2 +-
 src/common/iconbndl.cpp      | 2 +-
 src/common/imagbmp.cpp       | 2 +-
 src/common/image.cpp         | 2 +-
 src/common/imaggif.cpp       | 2 +-
 src/common/imagiff.cpp       | 2 +-
 src/common/imagjpeg.cpp      | 2 +-
 src/common/imagpcx.cpp       | 2 +-
 src/common/imagpng.cpp       | 2 +-
 src/common/imagpnm.cpp       | 2 +-
 src/common/imagtiff.cpp      | 2 +-
 src/common/imagxpm.cpp       | 2 +-
 src/common/intl.cpp          | 2 +-
 src/common/ipcbase.cpp       | 2 +-
 src/common/layout.cpp        | 2 +-
 src/common/lboxcmn.cpp       | 2 +-
 src/common/list.cpp          | 2 +-
 src/common/log.cpp           | 2 +-
 src/common/longlong.cpp      | 2 +-
 src/common/matrix.cpp        | 2 +-
 src/common/memory.cpp        | 4 ++--
 src/common/menucmn.cpp       | 2 +-
 src/common/module.cpp        | 2 +-
 src/common/msgout.cpp        | 2 +-
 src/common/mstream.cpp       | 2 +-
 src/common/nbkbase.cpp       | 2 +-
 src/common/object.cpp        | 2 +-
 src/common/paper.cpp         | 2 +-
 src/common/popupcmn.cpp      | 2 +-
 src/common/prntbase.cpp      | 2 +-
 src/common/process.cpp       | 2 +-
 src/common/protocol.cpp      | 2 +-
 src/common/quantize.cpp      | 2 +-
 src/common/radiocmn.cpp      | 2 +-
 src/common/regex.cpp         | 2 +-
 src/common/rgncmn.cpp        | 2 +-
 src/common/sckaddr.cpp       | 2 +-
 src/common/sckfile.cpp       | 2 +-
 src/common/sckipc.cpp        | 2 +-
 src/common/sckstrm.cpp       | 2 +-
 src/common/settcmn.cpp       | 2 +-
 src/common/sizer.cpp         | 2 +-
 src/common/socket.cpp        | 2 +-
 src/common/statbar.cpp       | 2 +-
 src/common/strconv.cpp       | 2 +-
 src/common/stream.cpp        | 2 +-
 src/common/string.cpp        | 2 +-
 src/common/sysopt.cpp        | 2 +-
 src/common/taskbarcmn.cpp    | 2 +-
 src/common/tbarbase.cpp      | 2 +-
 src/common/textbuf.cpp       | 2 +-
 src/common/textcmn.cpp       | 2 +-
 src/common/textfile.cpp      | 2 +-
 src/common/timercmn.cpp      | 2 +-
 src/common/tokenzr.cpp       | 2 +-
 src/common/toplvcmn.cpp      | 2 +-
 src/common/treebase.cpp      | 2 +-
 src/common/txtstrm.cpp       | 2 +-
 src/common/url.cpp           | 2 +-
 src/common/utilscmn.cpp      | 2 +-
 src/common/valgen.cpp        | 2 +-
 src/common/validate.cpp      | 2 +-
 src/common/valtext.cpp       | 2 +-
 src/common/variant.cpp       | 2 +-
 src/common/wfstream.cpp      | 2 +-
 src/common/wincmn.cpp        | 2 +-
 src/common/wxchar.cpp        | 2 +-
 src/common/xpmdecod.cpp      | 2 +-
 src/common/xti.cpp           | 2 +-
 src/common/xtistrm.cpp       | 2 +-
 src/common/zipstrm.cpp       | 2 +-
 src/common/zstream.cpp       | 2 +-
 src/generic/accel.cpp        | 2 +-
 src/generic/busyinfo.cpp     | 2 +-
 src/generic/calctrl.cpp      | 2 +-
 src/generic/caret.cpp        | 2 +-
 src/generic/choicdgg.cpp     | 2 +-
 src/generic/colrdlgg.cpp     | 2 +-
 src/generic/dcbuffer.cpp     | 2 +-
 src/generic/dcpsg.cpp        | 2 +-
 src/generic/dirctrlg.cpp     | 2 +-
 src/generic/dirdlgg.cpp      | 2 +-
 src/generic/dragimgg.cpp     | 2 +-
 src/generic/fdrepdlg.cpp     | 2 +-
 src/generic/filedlgg.cpp     | 2 +-
 src/generic/fontdlgg.cpp     | 2 +-
 src/generic/grid.cpp         | 2 +-
 src/generic/gridctrl.cpp     | 2 +-
 src/generic/gridsel.cpp      | 2 +-
 src/generic/helpext.cpp      | 2 +-
 src/generic/imaglist.cpp     | 2 +-
 src/generic/laywin.cpp       | 2 +-
 src/generic/listctrl.cpp     | 2 +-
 src/generic/logg.cpp         | 2 +-
 src/generic/mdig.cpp         | 2 +-
 src/generic/msgdlgg.cpp      | 2 +-
 src/generic/notebook.cpp     | 2 +-
 src/generic/numdlgg.cpp      | 2 +-
 src/generic/paletteg.cpp     | 2 +-
 src/generic/panelg.cpp       | 2 +-
 src/generic/printps.cpp      | 2 +-
 src/generic/prntdlgg.cpp     | 2 +-
 src/generic/progdlgg.cpp     | 2 +-
 src/generic/sashwin.cpp      | 2 +-
 src/generic/scrlwing.cpp     | 2 +-
 src/generic/spinctlg.cpp     | 2 +-
 src/generic/splash.cpp       | 2 +-
 src/generic/splitter.cpp     | 2 +-
 src/generic/statline.cpp     | 2 +-
 src/generic/statusbr.cpp     | 2 +-
 src/generic/tabg.cpp         | 2 +-
 src/generic/tbarsmpl.cpp     | 2 +-
 src/generic/textdlgg.cpp     | 2 +-
 src/generic/timer.cpp        | 2 +-
 src/generic/tipdlg.cpp       | 2 +-
 src/generic/tipwin.cpp       | 2 +-
 src/generic/treectlg.cpp     | 2 +-
 src/generic/vscroll.cpp      | 2 +-
 src/generic/wizard.cpp       | 2 +-
 src/gtk/app.cpp              | 5 ++++-
 src/gtk/bitmap.cpp           | 5 ++++-
 src/gtk/bmpbuttn.cpp         | 5 ++++-
 src/gtk/brush.cpp            | 5 ++++-
 src/gtk/button.cpp           | 5 ++++-
 src/gtk/checkbox.cpp         | 5 ++++-
 src/gtk/checklst.cpp         | 5 ++++-
 src/gtk/choice.cpp           | 2 +-
 src/gtk/clipbrd.cpp          | 5 ++++-
 src/gtk/colour.cpp           | 5 ++++-
 src/gtk/combobox.cpp         | 5 ++++-
 src/gtk/control.cpp          | 5 ++++-
 src/gtk/cursor.cpp           | 6 ++++--
 src/gtk/data.cpp             | 3 +++
 src/gtk/dataobj.cpp          | 5 ++++-
 src/gtk/dc.cpp               | 5 ++++-
 src/gtk/dcclient.cpp         | 5 ++++-
 src/gtk/dcmemory.cpp         | 5 ++++-
 src/gtk/dcscreen.cpp         | 5 ++++-
 src/gtk/dialog.cpp           | 5 ++++-
 src/gtk/dnd.cpp              | 5 ++++-
 src/gtk/evtloop.cpp          | 2 +-
 src/gtk/filedlg.cpp          | 5 ++++-
 src/gtk/font.cpp             | 5 ++++-
 src/gtk/fontdlg.cpp          | 5 ++++-
 src/gtk/frame.cpp            | 5 ++++-
 src/gtk/gauge.cpp            | 5 ++++-
 src/gtk/gdiobj.cpp           | 2 +-
 src/gtk/glcanvas.cpp         | 5 ++++-
 src/gtk/icon.cpp             | 5 ++++-
 src/gtk/listbox.cpp          | 5 ++++-
 src/gtk/mdi.cpp              | 5 ++++-
 src/gtk/menu.cpp             | 9 ++++++---
 src/gtk/minifram.cpp         | 7 +++++--
 src/gtk/msgdlg.cpp           | 2 +-
 src/gtk/notebook.cpp         | 5 ++++-
 src/gtk/pen.cpp              | 5 ++++-
 src/gtk/popupwin.cpp         | 5 +++--
 src/gtk/radiobox.cpp         | 5 +++--
 src/gtk/radiobut.cpp         | 5 +++--
 src/gtk/region.cpp           | 5 ++++-
 src/gtk/scrolbar.cpp         | 5 +++--
 src/gtk/scrolwin.cpp         | 2 +-
 src/gtk/settings.cpp         | 5 ++++-
 src/gtk/slider.cpp           | 5 ++++-
 src/gtk/spinbutt.cpp         | 5 ++++-
 src/gtk/spinctrl.cpp         | 5 ++++-
 src/gtk/statbmp.cpp          | 5 +++--
 src/gtk/statbox.cpp          | 5 +++--
 src/gtk/statline.cpp         | 5 ++++-
 src/gtk/stattext.cpp         | 6 +++---
 src/gtk/tbargtk.cpp          | 5 ++++-
 src/gtk/textctrl.cpp         | 5 ++++-
 src/gtk/tglbtn.cpp           | 3 +++
 src/gtk/threadno.cpp         | 5 ++++-
 src/gtk/threadsgi.cpp        | 5 ++++-
 src/gtk/timer.cpp            | 5 +++--
 src/gtk/tooltip.cpp          | 5 ++++-
 src/gtk/toplevel.cpp         | 5 ++++-
 src/gtk/treegtk.cpp          | 2 +-
 src/gtk/utilsgtk.cpp         | 3 +++
 src/gtk/utilsres.cpp         | 5 ++++-
 src/gtk/window.cpp           | 6 ++++--
 src/gtk1/app.cpp             | 5 ++++-
 src/gtk1/bitmap.cpp          | 5 ++++-
 src/gtk1/bmpbuttn.cpp        | 5 ++++-
 src/gtk1/brush.cpp           | 5 ++++-
 src/gtk1/button.cpp          | 5 ++++-
 src/gtk1/checkbox.cpp        | 5 ++++-
 src/gtk1/checklst.cpp        | 5 ++++-
 src/gtk1/choice.cpp          | 2 +-
 src/gtk1/clipbrd.cpp         | 5 ++++-
 src/gtk1/colour.cpp          | 5 ++++-
 src/gtk1/combobox.cpp        | 5 ++++-
 src/gtk1/control.cpp         | 5 ++++-
 src/gtk1/cursor.cpp          | 6 ++++--
 src/gtk1/data.cpp            | 3 +++
 src/gtk1/dataobj.cpp         | 5 ++++-
 src/gtk1/dc.cpp              | 5 ++++-
 src/gtk1/dcclient.cpp        | 5 ++++-
 src/gtk1/dcmemory.cpp        | 5 ++++-
 src/gtk1/dcscreen.cpp        | 5 ++++-
 src/gtk1/dialog.cpp          | 5 ++++-
 src/gtk1/dnd.cpp             | 5 ++++-
 src/gtk1/evtloop.cpp         | 2 +-
 src/gtk1/filedlg.cpp         | 5 ++++-
 src/gtk1/font.cpp            | 5 ++++-
 src/gtk1/fontdlg.cpp         | 5 ++++-
 src/gtk1/frame.cpp           | 5 ++++-
 src/gtk1/gauge.cpp           | 5 ++++-
 src/gtk1/gdiobj.cpp          | 2 +-
 src/gtk1/glcanvas.cpp        | 5 ++++-
 src/gtk1/icon.cpp            | 5 ++++-
 src/gtk1/listbox.cpp         | 5 ++++-
 src/gtk1/mdi.cpp             | 5 ++++-
 src/gtk1/menu.cpp            | 9 ++++++---
 src/gtk1/minifram.cpp        | 7 +++++--
 src/gtk1/msgdlg.cpp          | 2 +-
 src/gtk1/notebook.cpp        | 5 ++++-
 src/gtk1/pen.cpp             | 5 ++++-
 src/gtk1/popupwin.cpp        | 5 +++--
 src/gtk1/radiobox.cpp        | 5 +++--
 src/gtk1/radiobut.cpp        | 5 +++--
 src/gtk1/region.cpp          | 5 ++++-
 src/gtk1/scrolbar.cpp        | 5 +++--
 src/gtk1/scrolwin.cpp        | 2 +-
 src/gtk1/settings.cpp        | 5 ++++-
 src/gtk1/slider.cpp          | 5 ++++-
 src/gtk1/spinbutt.cpp        | 5 ++++-
 src/gtk1/spinctrl.cpp        | 5 ++++-
 src/gtk1/statbmp.cpp         | 5 +++--
 src/gtk1/statbox.cpp         | 5 +++--
 src/gtk1/statline.cpp        | 5 ++++-
 src/gtk1/stattext.cpp        | 6 +++---
 src/gtk1/tbargtk.cpp         | 5 ++++-
 src/gtk1/textctrl.cpp        | 5 ++++-
 src/gtk1/tglbtn.cpp          | 3 +++
 src/gtk1/threadno.cpp        | 5 ++++-
 src/gtk1/threadsgi.cpp       | 5 ++++-
 src/gtk1/timer.cpp           | 5 +++--
 src/gtk1/tooltip.cpp         | 5 ++++-
 src/gtk1/toplevel.cpp        | 5 ++++-
 src/gtk1/treegtk.cpp         | 2 +-
 src/gtk1/utilsgtk.cpp        | 3 +++
 src/gtk1/utilsres.cpp        | 5 ++++-
 src/gtk1/window.cpp          | 6 ++++--
 src/html/helpctrl.cpp        | 2 +-
 src/html/helpdata.cpp        | 2 +-
 src/html/helpfrm.cpp         | 2 +-
 src/html/htmlcell.cpp        | 2 +-
 src/html/htmlfilt.cpp        | 2 +-
 src/html/htmlpars.cpp        | 2 +-
 src/html/htmltag.cpp         | 2 +-
 src/html/htmlwin.cpp         | 2 +-
 src/html/htmprint.cpp        | 2 +-
 src/html/m_dflist.cpp        | 2 +-
 src/html/m_fonts.cpp         | 2 +-
 src/html/m_hline.cpp         | 2 +-
 src/html/m_image.cpp         | 2 +-
 src/html/m_layout.cpp        | 2 +-
 src/html/m_links.cpp         | 2 +-
 src/html/m_list.cpp          | 2 +-
 src/html/m_pre.cpp           | 2 +-
 src/html/m_style.cpp         | 2 +-
 src/html/m_tables.cpp        | 2 +-
 src/html/winpars.cpp         | 2 +-
 src/mgl/app.cpp              | 2 +-
 src/mgl/bitmap.cpp           | 2 +-
 src/mgl/brush.cpp            | 2 +-
 src/mgl/clipbrd.cpp          | 2 +-
 src/mgl/colour.cpp           | 2 +-
 src/mgl/cursor.cpp           | 2 +-
 src/mgl/dc.cpp               | 2 +-
 src/mgl/dcclient.cpp         | 2 +-
 src/mgl/dcmemory.cpp         | 2 +-
 src/mgl/dcscreen.cpp         | 2 +-
 src/mgl/dirmgl.cpp           | 2 +-
 src/mgl/evtloop.cpp          | 2 +-
 src/mgl/font.cpp             | 2 +-
 src/mgl/fontenum.cpp         | 2 +-
 src/mgl/fontutil.cpp         | 2 +-
 src/mgl/gdiobj.cpp           | 2 +-
 src/mgl/icon.cpp             | 2 +-
 src/mgl/palette.cpp          | 2 +-
 src/mgl/pen.cpp              | 2 +-
 src/mgl/region.cpp           | 2 +-
 src/mgl/settings.cpp         | 2 +-
 src/mgl/toplevel.cpp         | 2 +-
 src/mgl/window.cpp           | 2 +-
 src/motif/accel.cpp          | 2 +-
 src/motif/app.cpp            | 2 +-
 src/motif/bmpbuttn.cpp       | 2 +-
 src/motif/bmpmotif.cpp       | 2 +-
 src/motif/button.cpp         | 2 +-
 src/motif/checkbox.cpp       | 2 +-
 src/motif/checklst.cpp       | 2 +-
 src/motif/choice.cpp         | 2 +-
 src/motif/clipbrd.cpp        | 2 +-
 src/motif/colour.cpp         | 2 +-
 src/motif/combobox.cpp       | 2 +-
 src/motif/control.cpp        | 2 +-
 src/motif/cursor.cpp         | 2 +-
 src/motif/dataobj.cpp        | 2 +-
 src/motif/dc.cpp             | 2 +-
 src/motif/dcclient.cpp       | 2 +-
 src/motif/dcmemory.cpp       | 2 +-
 src/motif/dcscreen.cpp       | 2 +-
 src/motif/dialog.cpp         | 2 +-
 src/motif/dnd.cpp            | 2 +-
 src/motif/evtloop.cpp        | 2 +-
 src/motif/filedlg.cpp        | 2 +-
 src/motif/font.cpp           | 2 +-
 src/motif/frame.cpp          | 2 +-
 src/motif/gauge.cpp          | 2 +-
 src/motif/gdiobj.cpp         | 2 +-
 src/motif/glcanvas.cpp       | 2 +-
 src/motif/icon.cpp           | 2 +-
 src/motif/listbox.cpp        | 2 +-
 src/motif/mdi.cpp            | 2 +-
 src/motif/menu.cpp           | 2 +-
 src/motif/menuitem.cpp       | 2 +-
 src/motif/minifram.cpp       | 2 +-
 src/motif/msgdlg.cpp         | 2 +-
 src/motif/palette.cpp        | 2 +-
 src/motif/radiobox.cpp       | 2 +-
 src/motif/radiobut.cpp       | 2 +-
 src/motif/scrolbar.cpp       | 2 +-
 src/motif/settings.cpp       | 2 +-
 src/motif/slider.cpp         | 2 +-
 src/motif/spinbutt.cpp       | 2 +-
 src/motif/statbmp.cpp        | 2 +-
 src/motif/statbox.cpp        | 2 +-
 src/motif/stattext.cpp       | 2 +-
 src/motif/textctrl.cpp       | 2 +-
 src/motif/timer.cpp          | 2 +-
 src/motif/toolbar.cpp        | 2 +-
 src/motif/toplevel.cpp       | 2 +-
 src/motif/window.cpp         | 2 +-
 src/msw/accel.cpp            | 2 +-
 src/msw/app.cpp              | 2 +-
 src/msw/bitmap.cpp           | 2 +-
 src/msw/bmpbuttn.cpp         | 2 +-
 src/msw/brush.cpp            | 2 +-
 src/msw/button.cpp           | 2 +-
 src/msw/caret.cpp            | 2 +-
 src/msw/checkbox.cpp         | 2 +-
 src/msw/checklst.cpp         | 2 +-
 src/msw/choice.cpp           | 2 +-
 src/msw/clipbrd.cpp          | 2 +-
 src/msw/colordlg.cpp         | 2 +-
 src/msw/colour.cpp           | 2 +-
 src/msw/combobox.cpp         | 2 +-
 src/msw/control.cpp          | 2 +-
 src/msw/cursor.cpp           | 2 +-
 src/msw/data.cpp             | 2 +-
 src/msw/dc.cpp               | 2 +-
 src/msw/dcclient.cpp         | 2 +-
 src/msw/dcmemory.cpp         | 2 +-
 src/msw/dcprint.cpp          | 2 +-
 src/msw/dcscreen.cpp         | 2 +-
 src/msw/dde.cpp              | 2 +-
 src/msw/dialog.cpp           | 2 +-
 src/msw/dir.cpp              | 2 +-
 src/msw/dirdlg.cpp           | 2 +-
 src/msw/display.cpp          | 2 +-
 src/msw/dragimag.cpp         | 2 +-
 src/msw/enhmeta.cpp          | 2 +-
 src/msw/evtloop.cpp          | 2 +-
 src/msw/fdrepdlg.cpp         | 2 +-
 src/msw/filedlg.cpp          | 2 +-
 src/msw/font.cpp             | 2 +-
 src/msw/fontdlg.cpp          | 2 +-
 src/msw/fontenum.cpp         | 2 +-
 src/msw/fontutil.cpp         | 2 +-
 src/msw/frame.cpp            | 2 +-
 src/msw/gauge95.cpp          | 2 +-
 src/msw/gdiimage.cpp         | 2 +-
 src/msw/gdiobj.cpp           | 2 +-
 src/msw/glcanvas.cpp         | 2 +-
 src/msw/helpbest.cpp         | 2 +-
 src/msw/helpchm.cpp          | 2 +-
 src/msw/helpwin.cpp          | 2 +-
 src/msw/icon.cpp             | 2 +-
 src/msw/imaglist.cpp         | 2 +-
 src/msw/iniconf.cpp          | 2 +-
 src/msw/joystick.cpp         | 2 +-
 src/msw/listbox.cpp          | 2 +-
 src/msw/listctrl.cpp         | 2 +-
 src/msw/main.cpp             | 2 +-
 src/msw/mdi.cpp              | 2 +-
 src/msw/menu.cpp             | 2 +-
 src/msw/menuitem.cpp         | 2 +-
 src/msw/metafile.cpp         | 2 +-
 src/msw/microwin.c           | 2 +-
 src/msw/minifram.cpp         | 2 +-
 src/msw/msgdlg.cpp           | 2 +-
 src/msw/mslu.cpp             | 2 +-
 src/msw/nativdlg.cpp         | 2 +-
 src/msw/notebook.cpp         | 2 +-
 src/msw/ole/access.cpp       | 2 +-
 src/msw/ole/automtn.cpp      | 2 +-
 src/msw/ole/dataobj.cpp      | 2 +-
 src/msw/ole/dropsrc.cpp      | 2 +-
 src/msw/ole/droptgt.cpp      | 2 +-
 src/msw/ole/oleutils.cpp     | 2 +-
 src/msw/ole/uuid.cpp         | 2 +-
 src/msw/ownerdrw.cpp         | 2 +-
 src/msw/palette.cpp          | 2 +-
 src/msw/pen.cpp              | 2 +-
 src/msw/penwin.cpp           | 2 +-
 src/msw/popupwin.cpp         | 2 +-
 src/msw/printdlg.cpp         | 2 +-
 src/msw/printwin.cpp         | 2 +-
 src/msw/radiobox.cpp         | 2 +-
 src/msw/radiobut.cpp         | 2 +-
 src/msw/regconf.cpp          | 2 +-
 src/msw/region.cpp           | 2 +-
 src/msw/registry.cpp         | 2 +-
 src/msw/scrolbar.cpp         | 2 +-
 src/msw/slider95.cpp         | 2 +-
 src/msw/slidrmsw.cpp         | 2 +-
 src/msw/snglinst.cpp         | 2 +-
 src/msw/spinbutt.cpp         | 2 +-
 src/msw/spinctrl.cpp         | 2 +-
 src/msw/statbmp.cpp          | 2 +-
 src/msw/statbox.cpp          | 2 +-
 src/msw/statbr95.cpp         | 2 +-
 src/msw/statline.cpp         | 2 +-
 src/msw/stattext.cpp         | 2 +-
 src/msw/tabctrl.cpp          | 2 +-
 src/msw/taskbar.cpp          | 2 +-
 src/msw/tbar95.cpp           | 2 +-
 src/msw/tbarmsw.cpp          | 2 +-
 src/msw/textctrl.cpp         | 2 +-
 src/msw/thread.cpp           | 2 +-
 src/msw/timer.cpp            | 2 +-
 src/msw/toplevel.cpp         | 2 +-
 src/msw/treectrl.cpp         | 2 +-
 src/msw/utilsexc.cpp         | 2 +-
 src/msw/uxtheme.cpp          | 2 +-
 src/msw/volume.cpp           | 2 +-
 src/msw/wave.cpp             | 2 +-
 src/msw/wince/filedlgwce.cpp | 2 +-
 src/msw/wince/helpwce.cpp    | 2 +-
 src/msw/wince/tbarwce.cpp    | 2 +-
 src/msw/wince/time.cpp       | 2 +-
 src/msw/window.cpp           | 2 +-
 src/univ/bmpbuttn.cpp        | 2 +-
 src/univ/button.cpp          | 2 +-
 src/univ/checkbox.cpp        | 2 +-
 src/univ/checklst.cpp        | 2 +-
 src/univ/choice.cpp          | 2 +-
 src/univ/colschem.cpp        | 2 +-
 src/univ/combobox.cpp        | 2 +-
 src/univ/control.cpp         | 2 +-
 src/univ/ctrlrend.cpp        | 2 +-
 src/univ/dialog.cpp          | 2 +-
 src/univ/framuniv.cpp        | 2 +-
 src/univ/gauge.cpp           | 2 +-
 src/univ/inpcons.cpp         | 2 +-
 src/univ/inphand.cpp         | 2 +-
 src/univ/listbox.cpp         | 2 +-
 src/univ/menu.cpp            | 2 +-
 src/univ/notebook.cpp        | 2 +-
 src/univ/radiobox.cpp        | 2 +-
 src/univ/radiobut.cpp        | 2 +-
 src/univ/scrarrow.cpp        | 2 +-
 src/univ/scrolbar.cpp        | 2 +-
 src/univ/scrthumb.cpp        | 2 +-
 src/univ/slider.cpp          | 2 +-
 src/univ/spinbutt.cpp        | 2 +-
 src/univ/statbmp.cpp         | 2 +-
 src/univ/statbox.cpp         | 2 +-
 src/univ/statline.cpp        | 2 +-
 src/univ/stattext.cpp        | 2 +-
 src/univ/statusbr.cpp        | 2 +-
 src/univ/textctrl.cpp        | 2 +-
 src/univ/theme.cpp           | 2 +-
 src/univ/toolbar.cpp         | 2 +-
 src/univ/topluniv.cpp        | 2 +-
 src/univ/winuniv.cpp         | 2 +-
 src/unix/dialup.cpp          | 9 ++++++---
 src/unix/dir.cpp             | 2 +-
 src/unix/displayx11.cpp      | 2 +-
 src/unix/fontenum.cpp        | 6 ++++--
 src/unix/fontutil.cpp        | 2 +-
 src/unix/joystick.cpp        | 5 ++++-
 src/unix/mimetype.cpp        | 2 +-
 src/unix/snglinst.cpp        | 2 +-
 src/unix/taskbarx11.cpp      | 2 +-
 src/unix/threadpsx.cpp       | 5 +++--
 src/unix/utilsunx.cpp        | 3 +++
 src/unix/utilsx11.cpp        | 3 +++
 src/unix/wave.cpp            | 5 ++++-
 src/x11/app.cpp              | 2 +-
 src/x11/bitmap.cpp           | 2 +-
 src/x11/brush.cpp            | 2 +-
 src/x11/clipbrd.cpp          | 2 +-
 src/x11/colour.cpp           | 2 +-
 src/x11/cursor.cpp           | 2 +-
 src/x11/dataobj.cpp          | 2 +-
 src/x11/dc.cpp               | 2 +-
 src/x11/dcclient.cpp         | 2 +-
 src/x11/dcmemory.cpp         | 2 +-
 src/x11/dcscreen.cpp         | 2 +-
 src/x11/dnd.cpp              | 2 +-
 src/x11/evtloop.cpp          | 2 +-
 src/x11/font.cpp             | 2 +-
 src/x11/gdiobj.cpp           | 2 +-
 src/x11/glcanvas.cpp         | 2 +-
 src/x11/icon.cpp             | 2 +-
 src/x11/joystick.cpp         | 2 +-
 src/x11/minifram.cpp         | 2 +-
 src/x11/palette.cpp          | 2 +-
 src/x11/pen.cpp              | 2 +-
 src/x11/popupwin.cpp         | 2 +-
 src/x11/region.cpp           | 2 +-
 src/x11/reparent.cpp         | 2 +-
 src/x11/settings.cpp         | 2 +-
 src/x11/textctrl.cpp         | 2 +-
 src/x11/toplevel.cpp         | 2 +-
 src/x11/window.cpp           | 2 +-
 src/xml/xml.cpp              | 2 +-
 579 files changed, 926 insertions(+), 604 deletions(-)

diff --git a/src/common/accesscmn.cpp b/src/common/accesscmn.cpp
index a5cb561baa..6a5838d077 100644
--- a/src/common/accesscmn.cpp
+++ b/src/common/accesscmn.cpp
@@ -12,7 +12,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "accessbase.h"
 #endif
 
diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp
index 906f2c48d5..fdf85e5b67 100644
--- a/src/common/appcmn.cpp
+++ b/src/common/appcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "appbase.h"
 #endif
 
diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp
index 1dda57dd33..e4c829757b 100644
--- a/src/common/artprov.cpp
+++ b/src/common/artprov.cpp
@@ -13,7 +13,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "artprov.h"
 #endif
 
diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp
index 951ff347c7..3db6041ebd 100644
--- a/src/common/bmpbase.cpp
+++ b/src/common/bmpbase.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bitmapbase.h"
 #endif
 
diff --git a/src/common/choiccmn.cpp b/src/common/choiccmn.cpp
index a8adee15fd..9fc8861528 100644
--- a/src/common/choiccmn.cpp
+++ b/src/common/choiccmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "choicebase.h"
 #endif
 
diff --git a/src/common/clipcmn.cpp b/src/common/clipcmn.cpp
index a0af907b6e..bbb7b68c67 100644
--- a/src/common/clipcmn.cpp
+++ b/src/common/clipcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "clipboardbase.h"
 #endif
 
diff --git a/src/common/clntdata.cpp b/src/common/clntdata.cpp
index 5b98d24f48..5291e8fa0c 100644
--- a/src/common/clntdata.cpp
+++ b/src/common/clntdata.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "clntdata.h"
 #endif
 
diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp
index 5313adf3e0..dc3a857e66 100644
--- a/src/common/cmdline.cpp
+++ b/src/common/cmdline.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "cmdline.h"
 #endif
 
diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp
index 09603432bd..08f414c171 100644
--- a/src/common/cmdproc.cpp
+++ b/src/common/cmdproc.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "cmdproc.h"
 #endif
 
diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp
index 157e32eb14..0595eacc27 100644
--- a/src/common/cmndata.cpp
+++ b/src/common/cmndata.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "cmndata.h"
 #endif
 
diff --git a/src/common/config.cpp b/src/common/config.cpp
index f9e071fee3..9b5612a4b0 100644
--- a/src/common/config.cpp
+++ b/src/common/config.cpp
@@ -13,7 +13,7 @@
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "confbase.h"
 #endif
 
diff --git a/src/common/containr.cpp b/src/common/containr.cpp
index f695be6334..dfb7a123d8 100644
--- a/src/common/containr.cpp
+++ b/src/common/containr.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "containr.h"
 #endif
 
diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp
index 17b26dae36..9e41da6a8a 100644
--- a/src/common/cshelp.cpp
+++ b/src/common/cshelp.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "cshelp.h"
 #endif
 
diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp
index d42a8ff04a..6b834f3aba 100644
--- a/src/common/ctrlcmn.cpp
+++ b/src/common/ctrlcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "controlbase.h"
     #pragma implementation "statbmpbase.h"
 #endif
diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp
index 93de1562da..9a7ec228e3 100644
--- a/src/common/ctrlsub.cpp
+++ b/src/common/ctrlsub.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "controlwithitems.h"
 #endif
 
diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp
index 77b81dda89..e2b9155f69 100644
--- a/src/common/datetime.cpp
+++ b/src/common/datetime.cpp
@@ -52,7 +52,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "datetime.h"
 #endif
 
diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp
index a7bf054ec0..1580055ca7 100644
--- a/src/common/datstrm.cpp
+++ b/src/common/datstrm.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "datstrm.h"
 #endif
 
diff --git a/src/common/db.cpp b/src/common/db.cpp
index ebbc3819fb..34df370696 100644
--- a/src/common/db.cpp
+++ b/src/common/db.cpp
@@ -34,7 +34,7 @@
 // SYNOPSIS START
 // SYNOPSIS STOP
 */
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "db.h"
 #endif
 
diff --git a/src/common/dbgrid.cpp b/src/common/dbgrid.cpp
index 4e41ffcd66..b7b2218e48 100644
--- a/src/common/dbgrid.cpp
+++ b/src/common/dbgrid.cpp
@@ -11,7 +11,7 @@
 // Branched From : dbgrid.cpp,v 1.18 2000/12/19 13:00:58
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dbgrid.h"
 #endif
 
diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp
index 1a8a58758a..b66711044c 100644
--- a/src/common/dbtable.cpp
+++ b/src/common/dbtable.cpp
@@ -25,7 +25,7 @@
 // SYNOPSIS STOP
 */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dbtable.h"
 #endif
 
diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp
index 77b09b154b..c525c04d8e 100644
--- a/src/common/dcbase.cpp
+++ b/src/common/dcbase.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcbase.h"
 #endif
 
diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp
index 8f2dd8e27b..801e2d1f9f 100644
--- a/src/common/dircmn.cpp
+++ b/src/common/dircmn.cpp
@@ -18,7 +18,7 @@
 // ----------------------------------------------------------------------------
 
 /* this is done in platform-specific files
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dir.h"
 #endif
 */
diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp
index 715b81920a..82501e06d9 100644
--- a/src/common/dlgcmn.cpp
+++ b/src/common/dlgcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dialogbase.h"
 #endif
 
diff --git a/src/common/dndcmn.cpp b/src/common/dndcmn.cpp
index aa9a861fd6..f3fe62d892 100644
--- a/src/common/dndcmn.cpp
+++ b/src/common/dndcmn.cpp
@@ -12,7 +12,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dndbase.h"
 #endif
 
diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp
index 432cb49bfe..55c16a3749 100644
--- a/src/common/dobjcmn.cpp
+++ b/src/common/dobjcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dataobjbase.h"
 #endif
 
diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp
index 4a9857983f..4d6141dd8c 100644
--- a/src/common/docmdi.cpp
+++ b/src/common/docmdi.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "docmdi.h"
 #endif
 
diff --git a/src/common/docview.cpp b/src/common/docview.cpp
index e43e8f25d6..bc34f64048 100644
--- a/src/common/docview.cpp
+++ b/src/common/docview.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "docview.h"
 #endif
 
diff --git a/src/common/dpycmn.cpp b/src/common/dpycmn.cpp
index 9a4b474cbe..8797f81ecb 100644
--- a/src/common/dpycmn.cpp
+++ b/src/common/dpycmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "displaybase.h"
 #endif
 
diff --git a/src/common/dseldlg.cpp b/src/common/dseldlg.cpp
index 86b2e1147d..36068fd617 100644
--- a/src/common/dseldlg.cpp
+++ b/src/common/dseldlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dseldlg.h"
 #endif
 
diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp
index 9933c0bc75..63a6dc76cf 100644
--- a/src/common/dynarray.cpp
+++ b/src/common/dynarray.cpp
@@ -13,7 +13,7 @@
 // headers
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dynarray.h"
 #endif
 
diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp
index 5bc1dc89b9..fb869777e9 100644
--- a/src/common/dynlib.cpp
+++ b/src/common/dynlib.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #   pragma implementation "dynlib.h"
 #endif
 
diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp
index e342678774..a0844febf6 100644
--- a/src/common/dynload.cpp
+++ b/src/common/dynload.cpp
@@ -10,7 +10,7 @@
 // Licence:      wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dynload.h"
 #endif
 
diff --git a/src/common/effects.cpp b/src/common/effects.cpp
index a5b2a828ea..454cde2081 100644
--- a/src/common/effects.cpp
+++ b/src/common/effects.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "effects.h"
 #endif
 
diff --git a/src/common/encconv.cpp b/src/common/encconv.cpp
index 802aca454e..03dc30ffb9 100644
--- a/src/common/encconv.cpp
+++ b/src/common/encconv.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "encconv.h"
 #endif
 
diff --git a/src/common/event.cpp b/src/common/event.cpp
index 49601ef677..29c1c3a690 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "event.h"
 #endif
 
diff --git a/src/common/fddlgcmn.cpp b/src/common/fddlgcmn.cpp
index d8c742511d..0a6438576e 100644
--- a/src/common/fddlgcmn.cpp
+++ b/src/common/fddlgcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fdrepdlg.h"
 #endif
 
diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp
index 6b09f9876b..95105fbfed 100644
--- a/src/common/ffile.cpp
+++ b/src/common/ffile.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "ffile.h"
 #endif
 
diff --git a/src/common/file.cpp b/src/common/file.cpp
index d8f53811f0..3d6fde63ea 100644
--- a/src/common/file.cpp
+++ b/src/common/file.cpp
@@ -14,7 +14,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "file.h"
 #endif
 
diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp
index 876047dfc6..15d5237f9b 100644
--- a/src/common/fileconf.cpp
+++ b/src/common/fileconf.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fileconf.h"
 #endif
 
diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
index 6978a4a25c..4f86e7bd16 100644
--- a/src/common/filefn.cpp
+++ b/src/common/filefn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "filefn.h"
 #endif
 
diff --git a/src/common/filename.cpp b/src/common/filename.cpp
index 6ccdee80d8..307018d906 100644
--- a/src/common/filename.cpp
+++ b/src/common/filename.cpp
@@ -60,7 +60,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filename.h"
 #endif
 
diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp
index c1e3070423..648130d001 100644
--- a/src/common/filesys.cpp
+++ b/src/common/filesys.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filesys.h"
 #endif
 
diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp
index bbdbe0d468..3f08486a1a 100644
--- a/src/common/fldlgcmn.cpp
+++ b/src/common/fldlgcmn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filedlg.h"
 #endif
 
diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp
index 764a4ed47e..f1b77746b2 100644
--- a/src/common/fontcmn.cpp
+++ b/src/common/fontcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fontbase.h"
 #endif
 
diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp
index c0a6fd0c50..dc352cb054 100644
--- a/src/common/fontmap.cpp
+++ b/src/common/fontmap.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontmap.h"
 #endif
 
diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp
index cbf6bf21ee..87c94e3fe3 100644
--- a/src/common/framecmn.cpp
+++ b/src/common/framecmn.cpp
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "framebase.h"
 #endif
 
diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp
index 217d7bd72c..4356b665ea 100644
--- a/src/common/fs_inet.cpp
+++ b/src/common/fs_inet.cpp
@@ -19,7 +19,7 @@ limitation)
 
 */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fs_inet.h"
 #endif
 
diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp
index 81bf369765..7fd1569990 100644
--- a/src/common/fs_mem.cpp
+++ b/src/common/fs_mem.cpp
@@ -7,7 +7,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fs_mem.h"
 #endif
 
diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp
index 73f404a888..f3e807d87c 100644
--- a/src/common/fs_zip.cpp
+++ b/src/common/fs_zip.cpp
@@ -9,7 +9,7 @@
 
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fs_zip.h"
 #endif
 
diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp
index baac336f08..c85d7adbe3 100644
--- a/src/common/ftp.cpp
+++ b/src/common/ftp.cpp
@@ -17,7 +17,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "ftp.h"
 #endif
 
diff --git a/src/common/gaugecmn.cpp b/src/common/gaugecmn.cpp
index b7384ea545..4b5681f36d 100644
--- a/src/common/gaugecmn.cpp
+++ b/src/common/gaugecmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gaugebase.h"
 #endif
 
diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
index 280d4d94c3..846f44e355 100644
--- a/src/common/gdicmn.cpp
+++ b/src/common/gdicmn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdicmn.h"
 #endif
 
diff --git a/src/common/geometry.cpp b/src/common/geometry.cpp
index a01c529651..51fe2842ee 100644
--- a/src/common/geometry.cpp
+++ b/src/common/geometry.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "geometry.cpp"
 #endif
 
diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp
index 05c4073524..bf5280b4ef 100644
--- a/src/common/gifdecod.cpp
+++ b/src/common/gifdecod.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gifdecod.h"
 #endif
 
diff --git a/src/common/hash.cpp b/src/common/hash.cpp
index 1df6c30b78..db33f96e28 100644
--- a/src/common/hash.cpp
+++ b/src/common/hash.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "hash.h"
 #endif
 
diff --git a/src/common/hashmap.cpp b/src/common/hashmap.cpp
index 19a385d451..f86e192644 100644
--- a/src/common/hashmap.cpp
+++ b/src/common/hashmap.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "hashmap.h"
 #endif
 
diff --git a/src/common/helpbase.cpp b/src/common/helpbase.cpp
index 8ed3dff2f3..e47a7f7f05 100644
--- a/src/common/helpbase.cpp
+++ b/src/common/helpbase.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpbase.h"
 #endif
 
diff --git a/src/common/http.cpp b/src/common/http.cpp
index 9758181c72..3f5a86b4ae 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "http.h"
 #endif
 
diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp
index cd9bf9886a..661000a0ae 100644
--- a/src/common/iconbndl.cpp
+++ b/src/common/iconbndl.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "iconbndl.h"
 #endif
 
diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp
index ffe3162333..7570226e6e 100644
--- a/src/common/imagbmp.cpp
+++ b/src/common/imagbmp.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagbmp.h"
 #endif
 
diff --git a/src/common/image.cpp b/src/common/image.cpp
index 1d39aeff5c..b24e45100f 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "image.h"
 #endif
 
diff --git a/src/common/imaggif.cpp b/src/common/imaggif.cpp
index 1aed9a28cb..3a64963f92 100644
--- a/src/common/imaggif.cpp
+++ b/src/common/imaggif.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imaggif.h"
 #endif
 
diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp
index 432982552a..5722969269 100644
--- a/src/common/imagiff.cpp
+++ b/src/common/imagiff.cpp
@@ -12,7 +12,7 @@
 // by the author of xv, John Bradley for using the iff loading part
 // in wxWindows has been gratefully given.
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagiff.h"
 #endif
 
diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp
index b0a4e997e4..4173a9b5e7 100644
--- a/src/common/imagjpeg.cpp
+++ b/src/common/imagjpeg.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagjpeg.h"
 #endif
 
diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp
index f4d6852e66..cc45398eaf 100644
--- a/src/common/imagpcx.cpp
+++ b/src/common/imagpcx.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagpcx.h"
 #endif
 
diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp
index 99db62ed93..151d3c9986 100644
--- a/src/common/imagpng.cpp
+++ b/src/common/imagpng.cpp
@@ -11,7 +11,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagpng.h"
 #endif
 
diff --git a/src/common/imagpnm.cpp b/src/common/imagpnm.cpp
index 984de04ca4..cea78ca07e 100644
--- a/src/common/imagpnm.cpp
+++ b/src/common/imagpnm.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagpnm.h"
 #endif
 
diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp
index 657ff82ac5..0ff3f128f5 100644
--- a/src/common/imagtiff.cpp
+++ b/src/common/imagtiff.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagtiff.h"
 #endif
 
diff --git a/src/common/imagxpm.cpp b/src/common/imagxpm.cpp
index 485aa239c0..e0db84de12 100644
--- a/src/common/imagxpm.cpp
+++ b/src/common/imagxpm.cpp
@@ -62,7 +62,7 @@ license is as follows:
 %
 */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imagxpm.h"
 #endif
 
diff --git a/src/common/intl.cpp b/src/common/intl.cpp
index 85ae05c74b..1fd78f7aca 100644
--- a/src/common/intl.cpp
+++ b/src/common/intl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "intl.h"
 #endif
 
diff --git a/src/common/ipcbase.cpp b/src/common/ipcbase.cpp
index 7d74dca6ba..af60bef9ac 100644
--- a/src/common/ipcbase.cpp
+++ b/src/common/ipcbase.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "ipcbase.h"
 #endif
 
diff --git a/src/common/layout.cpp b/src/common/layout.cpp
index 8966a49b9f..eb3cc3abf8 100644
--- a/src/common/layout.cpp
+++ b/src/common/layout.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "layout.h"
 #endif
 
diff --git a/src/common/lboxcmn.cpp b/src/common/lboxcmn.cpp
index 671c54c39a..292bec8130 100644
--- a/src/common/lboxcmn.cpp
+++ b/src/common/lboxcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listboxbase.h"
 #endif
 
diff --git a/src/common/list.cpp b/src/common/list.cpp
index 9532eac9ca..26ace46fb5 100644
--- a/src/common/list.cpp
+++ b/src/common/list.cpp
@@ -17,7 +17,7 @@
 // headers
 // -----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "list.h"
 #endif
 
diff --git a/src/common/log.cpp b/src/common/log.cpp
index 0b2c63a205..4da49d8fe9 100644
--- a/src/common/log.cpp
+++ b/src/common/log.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "log.h"
 #endif
 
diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp
index 9265a4e803..4b08f13d66 100644
--- a/src/common/longlong.cpp
+++ b/src/common/longlong.cpp
@@ -15,7 +15,7 @@
 // headers
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "longlong.h"
 #endif
 
diff --git a/src/common/matrix.cpp b/src/common/matrix.cpp
index 96aee82855..d0d16755a3 100644
--- a/src/common/matrix.cpp
+++ b/src/common/matrix.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "matrix.h"
 #endif
 
diff --git a/src/common/memory.cpp b/src/common/memory.cpp
index 8dab25f747..29b31bdfeb 100644
--- a/src/common/memory.cpp
+++ b/src/common/memory.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "memory.h"
 #endif
 
@@ -26,7 +26,7 @@
 
 #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 // #pragma implementation
 #endif
 
diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp
index 7208dbbd49..1938ce4ca8 100644
--- a/src/common/menucmn.cpp
+++ b/src/common/menucmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menubase.h"
 #endif
 
diff --git a/src/common/module.cpp b/src/common/module.cpp
index e8ddb80a0a..70334f639d 100644
--- a/src/common/module.cpp
+++ b/src/common/module.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "module.h"
 #endif
 
diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp
index f66ffdc2b2..3c82430139 100755
--- a/src/common/msgout.cpp
+++ b/src/common/msgout.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "msgout.h"
 #endif
 
diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp
index dd26b5ed91..5aa97dcf21 100644
--- a/src/common/mstream.cpp
+++ b/src/common/mstream.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "mstream.h"
 #endif
 
diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp
index fcfd478e7c..0ca0e21941 100644
--- a/src/common/nbkbase.cpp
+++ b/src/common/nbkbase.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "notebookbase.h"
 #endif
 
diff --git a/src/common/object.cpp b/src/common/object.cpp
index 44e8d36ef3..e29f32860c 100644
--- a/src/common/object.cpp
+++ b/src/common/object.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "object.h"
 #endif
 
diff --git a/src/common/paper.cpp b/src/common/paper.cpp
index e207a9a4b1..0b14ff7597 100644
--- a/src/common/paper.cpp
+++ b/src/common/paper.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "paper.h"
 #endif
 
diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp
index f4d9bd55c2..d0414bce33 100644
--- a/src/common/popupcmn.cpp
+++ b/src/common/popupcmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "popupwinbase.h"
 #endif
 
diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp
index 8ab4583a89..581a057ba3 100644
--- a/src/common/prntbase.cpp
+++ b/src/common/prntbase.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "prntbase.h"
 #endif
 
diff --git a/src/common/process.cpp b/src/common/process.cpp
index cffb5f8569..6e6a931c2f 100644
--- a/src/common/process.cpp
+++ b/src/common/process.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "process.h"
 #endif
 
diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp
index ca133288c9..8d83bc6dbb 100644
--- a/src/common/protocol.cpp
+++ b/src/common/protocol.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "protocol.h"
 #endif
 
diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp
index 17231b4b71..b792d14833 100644
--- a/src/common/quantize.cpp
+++ b/src/common/quantize.cpp
@@ -30,7 +30,7 @@
 
 /* modified by Vaclav Slavik for use as jpeglib-independent module */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "quantize.h"
 #endif
 
diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp
index c1d1f5930e..c732658d75 100644
--- a/src/common/radiocmn.cpp
+++ b/src/common/radiocmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "radioboxbase.h"
 #endif
 
diff --git a/src/common/regex.cpp b/src/common/regex.cpp
index e39cde96bf..9c7e55c040 100644
--- a/src/common/regex.cpp
+++ b/src/common/regex.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "regex.h"
 #endif
 
diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp
index c192366f29..c4fb8fae0b 100644
--- a/src/common/rgncmn.cpp
+++ b/src/common/rgncmn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "rgncmn.h"
 #endif
 
diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp
index 80658f3314..33b51d153d 100644
--- a/src/common/sckaddr.cpp
+++ b/src/common/sckaddr.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "sckaddr.h"
 #endif
 
diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp
index a36b7756ce..5dbc6a0c12 100644
--- a/src/common/sckfile.cpp
+++ b/src/common/sckfile.cpp
@@ -8,7 +8,7 @@
 // Copyright:   (c) 1997, 1998 Guilhem Lavaux
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "sckfile.h"
 #endif
 
diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp
index ceeaec71fa..1c68aa540c 100644
--- a/src/common/sckipc.cpp
+++ b/src/common/sckipc.cpp
@@ -22,7 +22,7 @@
 // headers
 // --------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "sckipc.h"
 #endif
 
diff --git a/src/common/sckstrm.cpp b/src/common/sckstrm.cpp
index bc56194375..a65f0a0c03 100644
--- a/src/common/sckstrm.cpp
+++ b/src/common/sckstrm.cpp
@@ -8,7 +8,7 @@
 // Copyright:   (c)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "sckstrm.h"
 #endif
 
diff --git a/src/common/settcmn.cpp b/src/common/settcmn.cpp
index 977bc71207..be4269cd9b 100644
--- a/src/common/settcmn.cpp
+++ b/src/common/settcmn.cpp
@@ -15,7 +15,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "settings.h"
 #endif
 
diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp
index 87b68bee76..a882c510d2 100644
--- a/src/common/sizer.cpp
+++ b/src/common/sizer.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "sizer.h"
 #endif
 
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index 5816414509..18030b71e0 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -13,7 +13,7 @@
 // Declarations
 // ==========================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "socket.h"
 #endif
 
diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp
index 3867476a71..238802c0c2 100644
--- a/src/common/statbar.cpp
+++ b/src/common/statbar.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statbar.h"
 #endif
 
diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp
index 2279100d93..a5e08ae333 100644
--- a/src/common/strconv.cpp
+++ b/src/common/strconv.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "strconv.h"
 #endif
 
diff --git a/src/common/stream.cpp b/src/common/stream.cpp
index 2770a5df20..a612185f9c 100644
--- a/src/common/stream.cpp
+++ b/src/common/stream.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "stream.h"
 #endif
 
diff --git a/src/common/string.cpp b/src/common/string.cpp
index e15d84319d..2bd4e6178f 100644
--- a/src/common/string.cpp
+++ b/src/common/string.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "string.h"
 #endif
 
diff --git a/src/common/sysopt.cpp b/src/common/sysopt.cpp
index 2c3439278e..aa36947d7b 100644
--- a/src/common/sysopt.cpp
+++ b/src/common/sysopt.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "sysopt.h"
 #endif
 
diff --git a/src/common/taskbarcmn.cpp b/src/common/taskbarcmn.cpp
index 521ef18359..61414495e2 100644
--- a/src/common/taskbarcmn.cpp
+++ b/src/common/taskbarcmn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "taskbar.h"
 #endif
 
diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp
index b52d9476d1..1438c9f3c6 100644
--- a/src/common/tbarbase.cpp
+++ b/src/common/tbarbase.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbarbase.h"
 #endif
 
diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp
index c9df178872..e77cf8be0d 100644
--- a/src/common/textbuf.cpp
+++ b/src/common/textbuf.cpp
@@ -11,7 +11,7 @@
 // headers
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textbuf.h"
 #endif
 
diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp
index d43238231f..119ffc8c01 100644
--- a/src/common/textcmn.cpp
+++ b/src/common/textcmn.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textctrlbase.h"
 #endif
 
diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp
index 219b1b26f7..28593b36f5 100644
--- a/src/common/textfile.cpp
+++ b/src/common/textfile.cpp
@@ -13,7 +13,7 @@
 // headers
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textfile.h"
 #endif
 
diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp
index fc89d353ac..ffcf0358a9 100644
--- a/src/common/timercmn.cpp
+++ b/src/common/timercmn.cpp
@@ -18,7 +18,7 @@
 // wxWin headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "timerbase.h"
 #endif
 
diff --git a/src/common/tokenzr.cpp b/src/common/tokenzr.cpp
index a8946b57a3..937987241c 100644
--- a/src/common/tokenzr.cpp
+++ b/src/common/tokenzr.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tokenzr.h"
 #endif
 
diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp
index d5d6bb27fe..dc1a79b916 100644
--- a/src/common/toplvcmn.cpp
+++ b/src/common/toplvcmn.cpp
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevelbase.h"
 #endif
 
diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp
index 73bd16e5fb..e611c3a134 100644
--- a/src/common/treebase.cpp
+++ b/src/common/treebase.cpp
@@ -17,7 +17,7 @@
 // headers
 // -----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "treebase.h"
 #endif
 
diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp
index 55a7ac3580..36fab028f4 100644
--- a/src/common/txtstrm.cpp
+++ b/src/common/txtstrm.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "txtstrm.h"
 #endif
 
diff --git a/src/common/url.cpp b/src/common/url.cpp
index 192c68fd3b..bccda3d90f 100644
--- a/src/common/url.cpp
+++ b/src/common/url.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "url.h"
 #endif
 
diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp
index 4d111eaf53..9c60b60e45 100644
--- a/src/common/utilscmn.cpp
+++ b/src/common/utilscmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "utils.h"
 #endif
 
diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp
index f5c7a37a0e..4cf521922f 100644
--- a/src/common/valgen.cpp
+++ b/src/common/valgen.cpp
@@ -9,7 +9,7 @@
 // Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "valgen.h"
 #endif
 
diff --git a/src/common/validate.cpp b/src/common/validate.cpp
index d1ff855efb..64210336a3 100644
--- a/src/common/validate.cpp
+++ b/src/common/validate.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "validate.h"
 #endif
 
diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp
index 3c48fd2171..0e62b5ded3 100644
--- a/src/common/valtext.cpp
+++ b/src/common/valtext.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "valtext.h"
 #endif
 
diff --git a/src/common/variant.cpp b/src/common/variant.cpp
index 85ea9a9805..a697e75577 100644
--- a/src/common/variant.cpp
+++ b/src/common/variant.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "variant.h"
 #endif
 
diff --git a/src/common/wfstream.cpp b/src/common/wfstream.cpp
index da1651e2a5..0860226266 100644
--- a/src/common/wfstream.cpp
+++ b/src/common/wfstream.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "wfstream.h"
 #endif
 
diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp
index be19ab6146..f044c553cd 100644
--- a/src/common/wincmn.cpp
+++ b/src/common/wincmn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "windowbase.h"
 #endif
 
diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp
index 8353277d16..a0fead86ba 100644
--- a/src/common/wxchar.cpp
+++ b/src/common/wxchar.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "wxchar.h"
 #endif
 
diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp
index 4b4e47e045..35e9b0b521 100644
--- a/src/common/xpmdecod.cpp
+++ b/src/common/xpmdecod.cpp
@@ -90,7 +90,7 @@ license is as follows:
  * in this Software without prior written authorization from GROUPE BULL.
  */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xpmdecod.h"
 #endif
 
diff --git a/src/common/xti.cpp b/src/common/xti.cpp
index 6138a4984b..992dc46bef 100644
--- a/src/common/xti.cpp
+++ b/src/common/xti.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xti.h"
 #endif
 
diff --git a/src/common/xtistrm.cpp b/src/common/xtistrm.cpp
index 1c9be7b698..621341ae4f 100644
--- a/src/common/xtistrm.cpp
+++ b/src/common/xtistrm.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xtistrm.h"
 #endif
 
diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp
index 1ed942c0ea..6a7ebb12cc 100644
--- a/src/common/zipstrm.cpp
+++ b/src/common/zipstrm.cpp
@@ -6,7 +6,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "zipstrm.h"
 #endif
 
diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp
index f1380d5b64..c58f98f716 100644
--- a/src/common/zstream.cpp
+++ b/src/common/zstream.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "zstream.h"
 #endif
 
diff --git a/src/generic/accel.cpp b/src/generic/accel.cpp
index edf52970cd..50a7f9faaa 100644
--- a/src/generic/accel.cpp
+++ b/src/generic/accel.cpp
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "accel.h"
 #endif
 
diff --git a/src/generic/busyinfo.cpp b/src/generic/busyinfo.cpp
index ad0bd8af6b..69ebc54ead 100644
--- a/src/generic/busyinfo.cpp
+++ b/src/generic/busyinfo.cpp
@@ -6,7 +6,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "busyinfo.h"
 #endif
 
diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp
index 64d9ec719c..8a4b397da2 100644
--- a/src/generic/calctrl.cpp
+++ b/src/generic/calctrl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "calctrl.h"
 #endif
 
diff --git a/src/generic/caret.cpp b/src/generic/caret.cpp
index d199e5290f..e2039646c5 100644
--- a/src/generic/caret.cpp
+++ b/src/generic/caret.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "caret.h"
 #endif
 
diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp
index 695b283eef..3ab1c53a75 100644
--- a/src/generic/choicdgg.cpp
+++ b/src/generic/choicdgg.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "choicdgg.h"
 #endif
 
diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp
index 648fec1d4e..494858f390 100644
--- a/src/generic/colrdlgg.cpp
+++ b/src/generic/colrdlgg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colrdlgg.h"
 #endif
 
diff --git a/src/generic/dcbuffer.cpp b/src/generic/dcbuffer.cpp
index bc21ffa1df..4467604e23 100644
--- a/src/generic/dcbuffer.cpp
+++ b/src/generic/dcbuffer.cpp
@@ -10,7 +10,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcbuffer.h"
 #endif
 
diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp
index 5b5ad1c2f7..01abae5421 100644
--- a/src/generic/dcpsg.cpp
+++ b/src/generic/dcpsg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcpsg.h"
 #endif
 
diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp
index 2d3ad5a929..ab63062c75 100644
--- a/src/generic/dirctrlg.cpp
+++ b/src/generic/dirctrlg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dirctrlg.h"
 #endif
 
diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp
index 107967f521..9adf9232db 100644
--- a/src/generic/dirdlgg.cpp
+++ b/src/generic/dirdlgg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dirdlgg.h"
 #endif
 
diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp
index 9d6ae54d29..20e90cf378 100644
--- a/src/generic/dragimgg.cpp
+++ b/src/generic/dragimgg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dragimgg.h"
 #endif
 
diff --git a/src/generic/fdrepdlg.cpp b/src/generic/fdrepdlg.cpp
index e62385ca8e..df9998ed27 100644
--- a/src/generic/fdrepdlg.cpp
+++ b/src/generic/fdrepdlg.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "genericfdrepdlg.h"
 #endif
 
diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp
index 17333175ab..c4445150ae 100644
--- a/src/generic/filedlgg.cpp
+++ b/src/generic/filedlgg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filedlgg.h"
 #endif
 
diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp
index 6df6a4b308..40aed1a7dc 100644
--- a/src/generic/fontdlgg.cpp
+++ b/src/generic/fontdlgg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fontdlgg.h"
 #endif
 
diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index 43e4e40dc2..03bae1969d 100644
--- a/src/generic/grid.cpp
+++ b/src/generic/grid.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "grid.h"
 #endif
 
diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp
index 473f509125..a7491003d7 100644
--- a/src/generic/gridctrl.cpp
+++ b/src/generic/gridctrl.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gridctrl.h"
 #endif
 
diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp
index 56c8460a49..8fcdcde92f 100644
--- a/src/generic/gridsel.cpp
+++ b/src/generic/gridsel.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gridsel.h"
 #endif
 
diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp
index 0ba8104d47..39ec7e094a 100644
--- a/src/generic/helpext.cpp
+++ b/src/generic/helpext.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #   pragma implementation "wxexthlp.h"
 #endif
 
diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp
index 15ec2cc5e1..9021b540cb 100644
--- a/src/generic/imaglist.cpp
+++ b/src/generic/imaglist.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "imaglist.h"
 #endif
 
diff --git a/src/generic/laywin.cpp b/src/generic/laywin.cpp
index e32bb52e57..738e819a0d 100644
--- a/src/generic/laywin.cpp
+++ b/src/generic/laywin.cpp
@@ -12,7 +12,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "laywin.h"
 #endif
 
diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp
index ac046f88fd..21f74335b6 100644
--- a/src/generic/listctrl.cpp
+++ b/src/generic/listctrl.cpp
@@ -23,7 +23,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listctrl.h"
     #pragma implementation "listctrlbase.h"
 #endif
diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp
index 67bd5716b9..ca78f51f9e 100644
--- a/src/generic/logg.cpp
+++ b/src/generic/logg.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "logg.h"
 #endif
 
diff --git a/src/generic/mdig.cpp b/src/generic/mdig.cpp
index 5335360296..3c217b805e 100644
--- a/src/generic/mdig.cpp
+++ b/src/generic/mdig.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mdig.h"
 #endif
 
diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp
index 96b6cc0a67..7e2d9de6c0 100644
--- a/src/generic/msgdlgg.cpp
+++ b/src/generic/msgdlgg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "msgdlgg.h"
 #endif
 
diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp
index a320a42b99..4034ee2157 100644
--- a/src/generic/notebook.cpp
+++ b/src/generic/notebook.cpp
@@ -16,7 +16,7 @@
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "notebook.h"
 #endif
 
diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp
index c5d186384e..a259657828 100644
--- a/src/generic/numdlgg.cpp
+++ b/src/generic/numdlgg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "numdlgg.cpp"
 #endif
 
diff --git a/src/generic/paletteg.cpp b/src/generic/paletteg.cpp
index 578f3f4e23..7121430633 100644
--- a/src/generic/paletteg.cpp
+++ b/src/generic/paletteg.cpp
@@ -9,7 +9,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "paletteg.h"
 #endif
 
diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp
index e7d762317b..8213de3ba1 100644
--- a/src/generic/panelg.cpp
+++ b/src/generic/panelg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "panelg.h"
 #endif
 
diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp
index d9e0259f74..628b97a4b8 100644
--- a/src/generic/printps.cpp
+++ b/src/generic/printps.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "printps.h"
 #endif
 
diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp
index e7a3330a8f..ec7a43453c 100644
--- a/src/generic/prntdlgg.cpp
+++ b/src/generic/prntdlgg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "prntdlgg.h"
 #endif
 
diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp
index 4bdb7c3fea..2098d95e67 100644
--- a/src/generic/progdlgg.cpp
+++ b/src/generic/progdlgg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "progdlgg.h"
 #endif
 
diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp
index 5d00773b5c..1a7fdee5dc 100644
--- a/src/generic/sashwin.cpp
+++ b/src/generic/sashwin.cpp
@@ -11,7 +11,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "sashwin.h"
 #endif
 
diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp
index 726b6c1935..f868dd053b 100644
--- a/src/generic/scrlwing.cpp
+++ b/src/generic/scrlwing.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "genscrolwin.h"
 #endif
 
diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp
index 1136b29f96..91ae4c9f5f 100644
--- a/src/generic/spinctlg.cpp
+++ b/src/generic/spinctlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinctlg.h"
 #endif
 
diff --git a/src/generic/splash.cpp b/src/generic/splash.cpp
index d5b8da7896..d498bb4e55 100644
--- a/src/generic/splash.cpp
+++ b/src/generic/splash.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "splash.h"
 #endif
 
diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp
index 46e4c888f5..078cdb7f7b 100644
--- a/src/generic/splitter.cpp
+++ b/src/generic/splitter.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "splitter.h"
 #endif
 
diff --git a/src/generic/statline.cpp b/src/generic/statline.cpp
index a7e4f99dc1..28fd5b63d5 100644
--- a/src/generic/statline.cpp
+++ b/src/generic/statline.cpp
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statline.h"
 #endif
 
diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp
index ce2b35cb4b..0b6b9e8580 100644
--- a/src/generic/statusbr.cpp
+++ b/src/generic/statusbr.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statusbr.h"
 #endif
 
diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp
index d1b044d937..89cd65ab64 100644
--- a/src/generic/tabg.cpp
+++ b/src/generic/tabg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "tabg.h"
 #endif
 
diff --git a/src/generic/tbarsmpl.cpp b/src/generic/tbarsmpl.cpp
index 51699c845c..d0ebf2e44e 100644
--- a/src/generic/tbarsmpl.cpp
+++ b/src/generic/tbarsmpl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbarsmpl.h"
 #endif
 
diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp
index 55772c3c0e..6e0ab1e48d 100644
--- a/src/generic/textdlgg.cpp
+++ b/src/generic/textdlgg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textdlgg.h"
 #endif
 
diff --git a/src/generic/timer.cpp b/src/generic/timer.cpp
index 46fbe6a0c3..a4afe39e25 100644
--- a/src/generic/timer.cpp
+++ b/src/generic/timer.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "timer.h"
 #endif
 
diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp
index fd74ee77ab..bac3433d8a 100644
--- a/src/generic/tipdlg.cpp
+++ b/src/generic/tipdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tipdlg.h"
 #endif
 
diff --git a/src/generic/tipwin.cpp b/src/generic/tipwin.cpp
index 37ef8ee9d7..17093b2d9e 100644
--- a/src/generic/tipwin.cpp
+++ b/src/generic/tipwin.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tipwin.h"
 #endif
 
diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp
index 986c96f5b4..11236650e4 100644
--- a/src/generic/treectlg.cpp
+++ b/src/generic/treectlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // -----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "treectlg.h"
 #endif
 
diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp
index abe374f694..6c072dc9ab 100644
--- a/src/generic/vscroll.cpp
+++ b/src/generic/vscroll.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "vscroll.h"
 #endif
 
diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp
index 329399e221..6f703687d3 100644
--- a/src/generic/wizard.cpp
+++ b/src/generic/wizard.cpp
@@ -21,7 +21,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "wizardg.h"
 #endif
 
diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp
index 7df0bb49a2..ab2400fc2f 100644
--- a/src/gtk/app.cpp
+++ b/src/gtk/app.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #include <vms_jackets.h>
 #undef ConnectionNumber
diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp
index 4074770d26..05f616edce 100644
--- a/src/gtk/bitmap.cpp
+++ b/src/gtk/bitmap.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bitmap.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #include "wx/palette.h"
diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp
index 4f28995d7b..8e548b420c 100644
--- a/src/gtk/bmpbuttn.cpp
+++ b/src/gtk/bmpbuttn.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bmpbuttn.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_BMPBUTTON
diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp
index dd6720c868..1c08f89f07 100644
--- a/src/gtk/brush.cpp
+++ b/src/gtk/brush.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "brush.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/brush.h"
 #include "wx/colour.h"
 
diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp
index b61143a0ef..51caf3b9dc 100644
--- a/src/gtk/button.cpp
+++ b/src/gtk/button.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "button.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_BUTTON
diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp
index fb6cc16c42..a5316a29f2 100644
--- a/src/gtk/checkbox.cpp
+++ b/src/gtk/checkbox.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checkbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CHECKBOX
diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp
index 5a4f2469f5..fc1aa4602a 100644
--- a/src/gtk/checklst.cpp
+++ b/src/gtk/checklst.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checklst.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CHECKLISTBOX
diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp
index 5cda4d6808..d6bac5341e 100644
--- a/src/gtk/choice.cpp
+++ b/src/gtk/choice.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "choice.h"
 #endif
 
diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp
index 251709b69e..6f316b16ee 100644
--- a/src/gtk/clipbrd.cpp
+++ b/src/gtk/clipbrd.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "clipbrd.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/clipbrd.h"
 
 #if wxUSE_CLIPBOARD
diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp
index ce9b00c4c1..3b148e7bd3 100644
--- a/src/gtk/colour.cpp
+++ b/src/gtk/colour.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/gdicmn.h"
 #include "wx/colour.h"
 #include "wx/gtk/private.h"
diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp
index 7db2b2f750..29eaf88f4f 100644
--- a/src/gtk/combobox.cpp
+++ b/src/gtk/combobox.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "combobox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/combobox.h"
 
 #if wxUSE_COMBOBOX
diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp
index 3c005c4329..82f10af912 100644
--- a/src/gtk/control.cpp
+++ b/src/gtk/control.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "control.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CONTROLS
diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp
index fe6c31ea39..f23daacbb9 100644
--- a/src/gtk/cursor.cpp
+++ b/src/gtk/cursor.cpp
@@ -7,11 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/cursor.h"
 #include "wx/utils.h"
 #include "wx/app.h"
diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp
index 791691b345..f0626d1448 100644
--- a/src/gtk/data.cpp
+++ b/src/gtk/data.cpp
@@ -7,6 +7,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 #include "wx/object.h"
 #include "wx/window.h"
diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp
index 2b0f4f43ae..3da4095b2b 100644
--- a/src/gtk/dataobj.cpp
+++ b/src/gtk/dataobj.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dataobj.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dataobj.h"
 #include "wx/app.h"
 #include "wx/debug.h"
diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp
index aa54a1ae8e..11b2991b40 100644
--- a/src/gtk/dc.cpp
+++ b/src/gtk/dc.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dc.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp
index 43183328f9..47c3ec2174 100644
--- a/src/gtk/dcclient.cpp
+++ b/src/gtk/dcclient.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcclient.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XCopyPlane XCOPYPLANE
 #endif
diff --git a/src/gtk/dcmemory.cpp b/src/gtk/dcmemory.cpp
index 3c843eae1d..0ec10532b7 100644
--- a/src/gtk/dcmemory.cpp
+++ b/src/gtk/dcmemory.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcmemory.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dcmemory.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk/dcscreen.cpp b/src/gtk/dcscreen.cpp
index a79f479bbf..b404333e13 100644
--- a/src/gtk/dcscreen.cpp
+++ b/src/gtk/dcscreen.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dcscreen.h"
 #include "wx/window.h"
 
diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp
index 4c95d23682..644f2a8994 100644
--- a/src/gtk/dialog.cpp
+++ b/src/gtk/dialog.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dialog.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dialog.h"
 #include "wx/frame.h"
 #include "wx/app.h"
diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp
index 93f307cf8e..2181646be5 100644
--- a/src/gtk/dnd.cpp
+++ b/src/gtk/dnd.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dnd.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dnd.h"
 #include "wx/log.h"
 									       
diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp
index c602dead45..9ff74e58c3 100644
--- a/src/gtk/evtloop.cpp
+++ b/src/gtk/evtloop.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp
index b28750152a..9866a89f3a 100644
--- a/src/gtk/filedlg.cpp
+++ b/src/gtk/filedlg.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filedlg.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/filedlg.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp
index b616789edb..9987e141cc 100644
--- a/src/gtk/font.cpp
+++ b/src/gtk/font.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/font.h"
 #include "wx/fontutil.h"
 #include "wx/cmndata.h"
diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp
index 0c11da99a5..10352b6375 100644
--- a/src/gtk/fontdlg.cpp
+++ b/src/gtk/fontdlg.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fontdlg.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_FONTDLG
diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp
index fd6e17f28a..4bdfe079d3 100644
--- a/src/gtk/frame.cpp
+++ b/src/gtk/frame.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "frame.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #include "wx/dialog.h"
diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp
index f180206c79..693dbce205 100644
--- a/src/gtk/gauge.cpp
+++ b/src/gtk/gauge.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gauge.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/gauge.h"
 
 #if wxUSE_GAUGE
diff --git a/src/gtk/gdiobj.cpp b/src/gtk/gdiobj.cpp
index 38a919ade2..63a3ca364c 100644
--- a/src/gtk/gdiobj.cpp
+++ b/src/gtk/gdiobj.cpp
@@ -7,7 +7,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp
index d1ace2efe1..f9599d1aa4 100644
--- a/src/gtk/glcanvas.cpp
+++ b/src/gtk/glcanvas.cpp
@@ -9,10 +9,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "glcanvas.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/setup.h"
 
 #if wxUSE_GLCANVAS
diff --git a/src/gtk/icon.cpp b/src/gtk/icon.cpp
index 05c1089158..ef9780a56c 100644
--- a/src/gtk/icon.cpp
+++ b/src/gtk/icon.cpp
@@ -7,10 +7,13 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "icon.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/icon.h"
 
 //-----------------------------------------------------------------------------
diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp
index e9540a1e44..56f3a23383 100644
--- a/src/gtk/listbox.cpp
+++ b/src/gtk/listbox.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "listbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_LISTBOX
diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp
index 8cf797cd63..6f88db3f39 100644
--- a/src/gtk/mdi.cpp
+++ b/src/gtk/mdi.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "mdi.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/mdi.h"
 
 #if wxUSE_MDI_ARCHITECTURE
diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp
index f4c539a103..a287ee3439 100644
--- a/src/gtk/menu.cpp
+++ b/src/gtk/menu.cpp
@@ -7,11 +7,14 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "menu.h"
-#pragma implementation "menuitem.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+    #pragma implementation "menu.h"
+    #pragma implementation "menuitem.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/log.h"
 #include "wx/intl.h"
 #include "wx/app.h"
diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp
index c23782237b..916328b6a5 100644
--- a/src/gtk/minifram.cpp
+++ b/src/gtk/minifram.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "minifram.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+    #pragma implementation "minifram.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/minifram.h"
 
 #if wxUSE_MINIFRAME
diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp
index 85ac15e5eb..d700da2101 100644
--- a/src/gtk/msgdlg.cpp
+++ b/src/gtk/msgdlg.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "msgdlg.h"
 #endif
 
diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp
index 33aa5ab39d..033a147251 100644
--- a/src/gtk/notebook.cpp
+++ b/src/gtk/notebook.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "notebook.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/notebook.h"
 
 #if wxUSE_NOTEBOOK
diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp
index 7fb6e0cd0d..ee89ada46a 100644
--- a/src/gtk/pen.cpp
+++ b/src/gtk/pen.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "pen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/pen.h"
 #include "wx/colour.h"
 
diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp
index ace707144e..4c6a9f8cbc 100644
--- a/src/gtk/popupwin.cpp
+++ b/src/gtk/popupwin.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "popupwin.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_POPUPWIN
 
diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp
index 855f838e87..1dbff8ad50 100644
--- a/src/gtk/radiobox.cpp
+++ b/src/gtk/radiobox.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobox.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_RADIOBOX
 
diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp
index 3bc0caaa13..e79978e8b7 100644
--- a/src/gtk/radiobut.cpp
+++ b/src/gtk/radiobut.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobut.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_RADIOBOX
 
diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp
index f9ac057cbe..20746fb14b 100644
--- a/src/gtk/region.cpp
+++ b/src/gtk/region.cpp
@@ -12,7 +12,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "region.h"
 #endif
 
@@ -20,6 +20,9 @@
 // headers
 // ----------------------------------------------------------------------------
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/log.h"
 
 #include "wx/region.h"
diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp
index 42fa93452d..60750087df 100644
--- a/src/gtk/scrolbar.cpp
+++ b/src/gtk/scrolbar.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "scrolbar.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_SCROLLBAR
 
diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp
index 9745fb21a1..9232d1e543 100644
--- a/src/gtk/scrolwin.cpp
+++ b/src/gtk/scrolwin.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "scrolwin.h"
 #endif
 
diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp
index fded8203fd..510f5a4be1 100644
--- a/src/gtk/settings.cpp
+++ b/src/gtk/settings.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settings.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/settings.h"
 #include "wx/debug.h"
 #include "wx/module.h"
diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp
index 799f21d2b1..27f9bdd393 100644
--- a/src/gtk/slider.cpp
+++ b/src/gtk/slider.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slider.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/slider.h"
 
 #if wxUSE_SLIDER
diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp
index 2688602473..899c30c816 100644
--- a/src/gtk/spinbutt.cpp
+++ b/src/gtk/spinbutt.cpp
@@ -8,11 +8,14 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinbutt.h"
     #pragma implementation "spinbutbase.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/spinbutt.h"
 
 #if wxUSE_SPINBTN
diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp
index 2fbffa6771..989b574e37 100644
--- a/src/gtk/spinctrl.cpp
+++ b/src/gtk/spinctrl.cpp
@@ -8,10 +8,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "spinctrl.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/spinctrl.h"
 
 #if wxUSE_SPINCTRL
diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp
index 91b5df6215..e069dbfbf2 100644
--- a/src/gtk/statbmp.cpp
+++ b/src/gtk/statbmp.cpp
@@ -7,11 +7,12 @@
 // Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbmp.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATBMP
 
diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp
index 5777e99153..6610fad49d 100644
--- a/src/gtk/statbox.cpp
+++ b/src/gtk/statbox.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbox.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATBOX
 
diff --git a/src/gtk/statline.cpp b/src/gtk/statline.cpp
index 4e8f0787cb..d4299aa62e 100644
--- a/src/gtk/statline.cpp
+++ b/src/gtk/statline.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statline.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/statline.h"
 
 #if wxUSE_STATLINE
diff --git a/src/gtk/stattext.cpp b/src/gtk/stattext.cpp
index 53fe9f98e5..90c9857ac0 100644
--- a/src/gtk/stattext.cpp
+++ b/src/gtk/stattext.cpp
@@ -7,12 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "stattext.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATTEXT
 
diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp
index b3ab910bfd..496fa62618 100644
--- a/src/gtk/tbargtk.cpp
+++ b/src/gtk/tbargtk.cpp
@@ -16,10 +16,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbargtk.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/toolbar.h"
 
 #if wxUSE_TOOLBAR_NATIVE
diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp
index 0b1fc61efe..8e07499441 100644
--- a/src/gtk/textctrl.cpp
+++ b/src/gtk/textctrl.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "textctrl.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/textctrl.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp
index f103789376..e5baaa3835 100644
--- a/src/gtk/tglbtn.cpp
+++ b/src/gtk/tglbtn.cpp
@@ -10,6 +10,9 @@
 // License:     Rocketeer license
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/tglbtn.h"
 #include "wx/button.h"
 
diff --git a/src/gtk/threadno.cpp b/src/gtk/threadno.cpp
index 4ac3f05954..8907b7d39d 100644
--- a/src/gtk/threadno.cpp
+++ b/src/gtk/threadno.cpp
@@ -9,10 +9,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "thread.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/wx.h"
 #include "wx/module.h"
 #include "wx/thread.h"
diff --git a/src/gtk/threadsgi.cpp b/src/gtk/threadsgi.cpp
index 217f67d7d9..cc65251bb0 100644
--- a/src/gtk/threadsgi.cpp
+++ b/src/gtk/threadsgi.cpp
@@ -8,10 +8,13 @@
 // Copyright:   (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "thread.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include <stdio.h>
 #include <unistd.h>
 
diff --git a/src/gtk/timer.cpp b/src/gtk/timer.cpp
index f5330bc012..0353bede8b 100644
--- a/src/gtk/timer.cpp
+++ b/src/gtk/timer.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "timer.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_TIMER
 
diff --git a/src/gtk/tooltip.cpp b/src/gtk/tooltip.cpp
index 145eee8837..5dd9d17137 100644
--- a/src/gtk/tooltip.cpp
+++ b/src/gtk/tooltip.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tooltip.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/setup.h"
 
 #if wxUSE_TOOLTIPS
diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp
index 129e4fbb7c..9660e9d30e 100644
--- a/src/gtk/toplevel.cpp
+++ b/src/gtk/toplevel.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XIconifyWindow XICONIFYWINDOW
 #endif
diff --git a/src/gtk/treegtk.cpp b/src/gtk/treegtk.cpp
index 98f7fa7893..8c2dd7b4a4 100644
--- a/src/gtk/treegtk.cpp
+++ b/src/gtk/treegtk.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "treectrl.h"
 #endif
 
diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp
index 89dfaec185..69f73141b6 100644
--- a/src/gtk/utilsgtk.cpp
+++ b/src/gtk/utilsgtk.cpp
@@ -7,6 +7,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/utils.h"
 #include "wx/string.h"
 
diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp
index cf2e22fa69..69c6097176 100644
--- a/src/gtk/utilsres.cpp
+++ b/src/gtk/utilsres.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-//#ifdef __GNUG__
+//#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 //#pragma implementation "utils.h"
 //#endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/utils.h"
 #include "wx/string.h"
 #include "wx/list.h"
diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp
index 475c06f37f..9b8fc44a59 100644
--- a/src/gtk/window.cpp
+++ b/src/gtk/window.cpp
@@ -8,15 +8,17 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XWarpPointer XWARPPOINTER
 #endif
 
-#include "wx/defs.h"
 #include "wx/window.h"
 #include "wx/dcclient.h"
 #include "wx/frame.h"
diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp
index 7df0bb49a2..ab2400fc2f 100644
--- a/src/gtk1/app.cpp
+++ b/src/gtk1/app.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #include <vms_jackets.h>
 #undef ConnectionNumber
diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp
index 4074770d26..05f616edce 100644
--- a/src/gtk1/bitmap.cpp
+++ b/src/gtk1/bitmap.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bitmap.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #include "wx/palette.h"
diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp
index 4f28995d7b..8e548b420c 100644
--- a/src/gtk1/bmpbuttn.cpp
+++ b/src/gtk1/bmpbuttn.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bmpbuttn.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_BMPBUTTON
diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp
index dd6720c868..1c08f89f07 100644
--- a/src/gtk1/brush.cpp
+++ b/src/gtk1/brush.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "brush.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/brush.h"
 #include "wx/colour.h"
 
diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp
index b61143a0ef..51caf3b9dc 100644
--- a/src/gtk1/button.cpp
+++ b/src/gtk1/button.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "button.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_BUTTON
diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp
index fb6cc16c42..a5316a29f2 100644
--- a/src/gtk1/checkbox.cpp
+++ b/src/gtk1/checkbox.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checkbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CHECKBOX
diff --git a/src/gtk1/checklst.cpp b/src/gtk1/checklst.cpp
index 5a4f2469f5..fc1aa4602a 100644
--- a/src/gtk1/checklst.cpp
+++ b/src/gtk1/checklst.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checklst.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CHECKLISTBOX
diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp
index 5cda4d6808..d6bac5341e 100644
--- a/src/gtk1/choice.cpp
+++ b/src/gtk1/choice.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "choice.h"
 #endif
 
diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp
index 251709b69e..6f316b16ee 100644
--- a/src/gtk1/clipbrd.cpp
+++ b/src/gtk1/clipbrd.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "clipbrd.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/clipbrd.h"
 
 #if wxUSE_CLIPBOARD
diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp
index ce9b00c4c1..3b148e7bd3 100644
--- a/src/gtk1/colour.cpp
+++ b/src/gtk1/colour.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/gdicmn.h"
 #include "wx/colour.h"
 #include "wx/gtk/private.h"
diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp
index 7db2b2f750..29eaf88f4f 100644
--- a/src/gtk1/combobox.cpp
+++ b/src/gtk1/combobox.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "combobox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/combobox.h"
 
 #if wxUSE_COMBOBOX
diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp
index 3c005c4329..82f10af912 100644
--- a/src/gtk1/control.cpp
+++ b/src/gtk1/control.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "control.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_CONTROLS
diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp
index fe6c31ea39..f23daacbb9 100644
--- a/src/gtk1/cursor.cpp
+++ b/src/gtk1/cursor.cpp
@@ -7,11 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/cursor.h"
 #include "wx/utils.h"
 #include "wx/app.h"
diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp
index 791691b345..f0626d1448 100644
--- a/src/gtk1/data.cpp
+++ b/src/gtk1/data.cpp
@@ -7,6 +7,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 #include "wx/object.h"
 #include "wx/window.h"
diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp
index 2b0f4f43ae..3da4095b2b 100644
--- a/src/gtk1/dataobj.cpp
+++ b/src/gtk1/dataobj.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dataobj.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dataobj.h"
 #include "wx/app.h"
 #include "wx/debug.h"
diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp
index aa54a1ae8e..11b2991b40 100644
--- a/src/gtk1/dc.cpp
+++ b/src/gtk1/dc.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dc.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp
index 43183328f9..47c3ec2174 100644
--- a/src/gtk1/dcclient.cpp
+++ b/src/gtk1/dcclient.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcclient.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XCopyPlane XCOPYPLANE
 #endif
diff --git a/src/gtk1/dcmemory.cpp b/src/gtk1/dcmemory.cpp
index 3c843eae1d..0ec10532b7 100644
--- a/src/gtk1/dcmemory.cpp
+++ b/src/gtk1/dcmemory.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcmemory.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dcmemory.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk1/dcscreen.cpp b/src/gtk1/dcscreen.cpp
index a79f479bbf..b404333e13 100644
--- a/src/gtk1/dcscreen.cpp
+++ b/src/gtk1/dcscreen.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dcscreen.h"
 #include "wx/window.h"
 
diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp
index 4c95d23682..644f2a8994 100644
--- a/src/gtk1/dialog.cpp
+++ b/src/gtk1/dialog.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dialog.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dialog.h"
 #include "wx/frame.h"
 #include "wx/app.h"
diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp
index 93f307cf8e..2181646be5 100644
--- a/src/gtk1/dnd.cpp
+++ b/src/gtk1/dnd.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dnd.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dnd.h"
 #include "wx/log.h"
 									       
diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp
index c602dead45..9ff74e58c3 100644
--- a/src/gtk1/evtloop.cpp
+++ b/src/gtk1/evtloop.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp
index b28750152a..9866a89f3a 100644
--- a/src/gtk1/filedlg.cpp
+++ b/src/gtk1/filedlg.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filedlg.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/filedlg.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp
index b616789edb..9987e141cc 100644
--- a/src/gtk1/font.cpp
+++ b/src/gtk1/font.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/font.h"
 #include "wx/fontutil.h"
 #include "wx/cmndata.h"
diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp
index 0c11da99a5..10352b6375 100644
--- a/src/gtk1/fontdlg.cpp
+++ b/src/gtk1/fontdlg.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "fontdlg.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_FONTDLG
diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp
index fd6e17f28a..4bdfe079d3 100644
--- a/src/gtk1/frame.cpp
+++ b/src/gtk1/frame.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "frame.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #include "wx/dialog.h"
diff --git a/src/gtk1/gauge.cpp b/src/gtk1/gauge.cpp
index f180206c79..693dbce205 100644
--- a/src/gtk1/gauge.cpp
+++ b/src/gtk1/gauge.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gauge.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/gauge.h"
 
 #if wxUSE_GAUGE
diff --git a/src/gtk1/gdiobj.cpp b/src/gtk1/gdiobj.cpp
index 38a919ade2..63a3ca364c 100644
--- a/src/gtk1/gdiobj.cpp
+++ b/src/gtk1/gdiobj.cpp
@@ -7,7 +7,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/gtk1/glcanvas.cpp b/src/gtk1/glcanvas.cpp
index d1ace2efe1..f9599d1aa4 100644
--- a/src/gtk1/glcanvas.cpp
+++ b/src/gtk1/glcanvas.cpp
@@ -9,10 +9,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "glcanvas.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/setup.h"
 
 #if wxUSE_GLCANVAS
diff --git a/src/gtk1/icon.cpp b/src/gtk1/icon.cpp
index 05c1089158..ef9780a56c 100644
--- a/src/gtk1/icon.cpp
+++ b/src/gtk1/icon.cpp
@@ -7,10 +7,13 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "icon.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/icon.h"
 
 //-----------------------------------------------------------------------------
diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp
index e9540a1e44..56f3a23383 100644
--- a/src/gtk1/listbox.cpp
+++ b/src/gtk1/listbox.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "listbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_LISTBOX
diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp
index 8cf797cd63..6f88db3f39 100644
--- a/src/gtk1/mdi.cpp
+++ b/src/gtk1/mdi.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "mdi.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/mdi.h"
 
 #if wxUSE_MDI_ARCHITECTURE
diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp
index f4c539a103..a287ee3439 100644
--- a/src/gtk1/menu.cpp
+++ b/src/gtk1/menu.cpp
@@ -7,11 +7,14 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "menu.h"
-#pragma implementation "menuitem.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+    #pragma implementation "menu.h"
+    #pragma implementation "menuitem.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/log.h"
 #include "wx/intl.h"
 #include "wx/app.h"
diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp
index c23782237b..916328b6a5 100644
--- a/src/gtk1/minifram.cpp
+++ b/src/gtk1/minifram.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "minifram.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+    #pragma implementation "minifram.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/minifram.h"
 
 #if wxUSE_MINIFRAME
diff --git a/src/gtk1/msgdlg.cpp b/src/gtk1/msgdlg.cpp
index 85ac15e5eb..d700da2101 100644
--- a/src/gtk1/msgdlg.cpp
+++ b/src/gtk1/msgdlg.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "msgdlg.h"
 #endif
 
diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp
index 33aa5ab39d..033a147251 100644
--- a/src/gtk1/notebook.cpp
+++ b/src/gtk1/notebook.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "notebook.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/notebook.h"
 
 #if wxUSE_NOTEBOOK
diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp
index 7fb6e0cd0d..ee89ada46a 100644
--- a/src/gtk1/pen.cpp
+++ b/src/gtk1/pen.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "pen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/pen.h"
 #include "wx/colour.h"
 
diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp
index ace707144e..4c6a9f8cbc 100644
--- a/src/gtk1/popupwin.cpp
+++ b/src/gtk1/popupwin.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "popupwin.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_POPUPWIN
 
diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp
index 855f838e87..1dbff8ad50 100644
--- a/src/gtk1/radiobox.cpp
+++ b/src/gtk1/radiobox.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobox.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_RADIOBOX
 
diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp
index 3bc0caaa13..e79978e8b7 100644
--- a/src/gtk1/radiobut.cpp
+++ b/src/gtk1/radiobut.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobut.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_RADIOBOX
 
diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp
index f9ac057cbe..20746fb14b 100644
--- a/src/gtk1/region.cpp
+++ b/src/gtk1/region.cpp
@@ -12,7 +12,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "region.h"
 #endif
 
@@ -20,6 +20,9 @@
 // headers
 // ----------------------------------------------------------------------------
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/log.h"
 
 #include "wx/region.h"
diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp
index 42fa93452d..60750087df 100644
--- a/src/gtk1/scrolbar.cpp
+++ b/src/gtk1/scrolbar.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "scrolbar.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_SCROLLBAR
 
diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp
index 9745fb21a1..9232d1e543 100644
--- a/src/gtk1/scrolwin.cpp
+++ b/src/gtk1/scrolwin.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "scrolwin.h"
 #endif
 
diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp
index fded8203fd..510f5a4be1 100644
--- a/src/gtk1/settings.cpp
+++ b/src/gtk1/settings.cpp
@@ -8,10 +8,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settings.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/settings.h"
 #include "wx/debug.h"
 #include "wx/module.h"
diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp
index 799f21d2b1..27f9bdd393 100644
--- a/src/gtk1/slider.cpp
+++ b/src/gtk1/slider.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slider.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/slider.h"
 
 #if wxUSE_SLIDER
diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp
index 2688602473..899c30c816 100644
--- a/src/gtk1/spinbutt.cpp
+++ b/src/gtk1/spinbutt.cpp
@@ -8,11 +8,14 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinbutt.h"
     #pragma implementation "spinbutbase.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/spinbutt.h"
 
 #if wxUSE_SPINBTN
diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp
index 2fbffa6771..989b574e37 100644
--- a/src/gtk1/spinctrl.cpp
+++ b/src/gtk1/spinctrl.cpp
@@ -8,10 +8,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "spinctrl.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/spinctrl.h"
 
 #if wxUSE_SPINCTRL
diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp
index 91b5df6215..e069dbfbf2 100644
--- a/src/gtk1/statbmp.cpp
+++ b/src/gtk1/statbmp.cpp
@@ -7,11 +7,12 @@
 // Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbmp.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATBMP
 
diff --git a/src/gtk1/statbox.cpp b/src/gtk1/statbox.cpp
index 5777e99153..6610fad49d 100644
--- a/src/gtk1/statbox.cpp
+++ b/src/gtk1/statbox.cpp
@@ -7,11 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbox.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATBOX
 
diff --git a/src/gtk1/statline.cpp b/src/gtk1/statline.cpp
index 4e8f0787cb..d4299aa62e 100644
--- a/src/gtk1/statline.cpp
+++ b/src/gtk1/statline.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statline.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/statline.h"
 
 #if wxUSE_STATLINE
diff --git a/src/gtk1/stattext.cpp b/src/gtk1/stattext.cpp
index 53fe9f98e5..90c9857ac0 100644
--- a/src/gtk1/stattext.cpp
+++ b/src/gtk1/stattext.cpp
@@ -7,12 +7,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "stattext.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_STATTEXT
 
diff --git a/src/gtk1/tbargtk.cpp b/src/gtk1/tbargtk.cpp
index b3ab910bfd..496fa62618 100644
--- a/src/gtk1/tbargtk.cpp
+++ b/src/gtk1/tbargtk.cpp
@@ -16,10 +16,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbargtk.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/toolbar.h"
 
 #if wxUSE_TOOLBAR_NATIVE
diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp
index 0b1fc61efe..8e07499441 100644
--- a/src/gtk1/textctrl.cpp
+++ b/src/gtk1/textctrl.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "textctrl.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/textctrl.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp
index f103789376..e5baaa3835 100644
--- a/src/gtk1/tglbtn.cpp
+++ b/src/gtk1/tglbtn.cpp
@@ -10,6 +10,9 @@
 // License:     Rocketeer license
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/tglbtn.h"
 #include "wx/button.h"
 
diff --git a/src/gtk1/threadno.cpp b/src/gtk1/threadno.cpp
index 4ac3f05954..8907b7d39d 100644
--- a/src/gtk1/threadno.cpp
+++ b/src/gtk1/threadno.cpp
@@ -9,10 +9,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "thread.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/wx.h"
 #include "wx/module.h"
 #include "wx/thread.h"
diff --git a/src/gtk1/threadsgi.cpp b/src/gtk1/threadsgi.cpp
index 217f67d7d9..cc65251bb0 100644
--- a/src/gtk1/threadsgi.cpp
+++ b/src/gtk1/threadsgi.cpp
@@ -8,10 +8,13 @@
 // Copyright:   (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "thread.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include <stdio.h>
 #include <unistd.h>
 
diff --git a/src/gtk1/timer.cpp b/src/gtk1/timer.cpp
index f5330bc012..0353bede8b 100644
--- a/src/gtk1/timer.cpp
+++ b/src/gtk1/timer.cpp
@@ -8,11 +8,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "timer.h"
 #endif
 
-#include "wx/defs.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_TIMER
 
diff --git a/src/gtk1/tooltip.cpp b/src/gtk1/tooltip.cpp
index 145eee8837..5dd9d17137 100644
--- a/src/gtk1/tooltip.cpp
+++ b/src/gtk1/tooltip.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tooltip.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/setup.h"
 
 #if wxUSE_TOOLTIPS
diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp
index 129e4fbb7c..9660e9d30e 100644
--- a/src/gtk1/toplevel.cpp
+++ b/src/gtk1/toplevel.cpp
@@ -15,10 +15,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XIconifyWindow XICONIFYWINDOW
 #endif
diff --git a/src/gtk1/treegtk.cpp b/src/gtk1/treegtk.cpp
index 98f7fa7893..8c2dd7b4a4 100644
--- a/src/gtk1/treegtk.cpp
+++ b/src/gtk1/treegtk.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "treectrl.h"
 #endif
 
diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp
index 89dfaec185..69f73141b6 100644
--- a/src/gtk1/utilsgtk.cpp
+++ b/src/gtk1/utilsgtk.cpp
@@ -7,6 +7,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/utils.h"
 #include "wx/string.h"
 
diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp
index cf2e22fa69..69c6097176 100644
--- a/src/gtk1/utilsres.cpp
+++ b/src/gtk1/utilsres.cpp
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-//#ifdef __GNUG__
+//#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 //#pragma implementation "utils.h"
 //#endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/utils.h"
 #include "wx/string.h"
 #include "wx/list.h"
diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp
index 475c06f37f..9b8fc44a59 100644
--- a/src/gtk1/window.cpp
+++ b/src/gtk1/window.cpp
@@ -8,15 +8,17 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XWarpPointer XWARPPOINTER
 #endif
 
-#include "wx/defs.h"
 #include "wx/window.h"
 #include "wx/dcclient.h"
 #include "wx/frame.h"
diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp
index 67726f7456..1a7b41339b 100644
--- a/src/html/helpctrl.cpp
+++ b/src/html/helpctrl.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpctrl.h"
 #endif
 
diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp
index 1327d261b5..ab8e0036fa 100644
--- a/src/html/helpdata.cpp
+++ b/src/html/helpdata.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpdata.h"
 #endif
 
diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp
index 123aa56c7b..c81e784db4 100644
--- a/src/html/helpfrm.cpp
+++ b/src/html/helpfrm.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpfrm.h"
 #endif
 
diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp
index e692487a1d..f378ce4a9e 100644
--- a/src/html/htmlcell.cpp
+++ b/src/html/htmlcell.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmlcell.h"
 #endif
 
diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp
index 7e1dc3c178..85cc8b74b2 100644
--- a/src/html/htmlfilt.cpp
+++ b/src/html/htmlfilt.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmlfilt.h"
 #endif
 
diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp
index b205c3305b..9718c67ee3 100644
--- a/src/html/htmlpars.cpp
+++ b/src/html/htmlpars.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmlpars.h"
 #endif
 
diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp
index 0d71df7cf7..656ec5efce 100644
--- a/src/html/htmltag.cpp
+++ b/src/html/htmltag.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmltag.h"
 #endif
 
diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp
index 2f5f65d49e..264f950c31 100644
--- a/src/html/htmlwin.cpp
+++ b/src/html/htmlwin.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmlwin.h"
 #pragma implementation "htmlproc.h"
 #endif
diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp
index 1206f2f870..24c0d7764c 100644
--- a/src/html/htmprint.cpp
+++ b/src/html/htmprint.cpp
@@ -9,7 +9,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmprint.h"
 #endif
 
diff --git a/src/html/m_dflist.cpp b/src/html/m_dflist.cpp
index a2832c96d4..e158936b78 100644
--- a/src/html/m_dflist.cpp
+++ b/src/html/m_dflist.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp
index 977949dab9..f9637a2d50 100644
--- a/src/html/m_fonts.cpp
+++ b/src/html/m_fonts.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_hline.cpp b/src/html/m_hline.cpp
index 8ba3037749..09e2bf50ac 100644
--- a/src/html/m_hline.cpp
+++ b/src/html/m_hline.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp
index 071d7d4167..a142580cd4 100644
--- a/src/html/m_image.cpp
+++ b/src/html/m_image.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp
index 3b18c44a57..46822c121a 100644
--- a/src/html/m_layout.cpp
+++ b/src/html/m_layout.cpp
@@ -6,7 +6,7 @@
 // Copyright:   (c) 1999 Vaclav Slavik
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_links.cpp b/src/html/m_links.cpp
index 7ae39b983a..c9881a1e58 100644
--- a/src/html/m_links.cpp
+++ b/src/html/m_links.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_list.cpp b/src/html/m_list.cpp
index 85ea4b35c5..4050ee9cc0 100644
--- a/src/html/m_list.cpp
+++ b/src/html/m_list.cpp
@@ -6,7 +6,7 @@
 // Copyright:   (c) 1999 Vaclav Slavik
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp
index 27fa27a31a..558f29e3d8 100644
--- a/src/html/m_pre.cpp
+++ b/src/html/m_pre.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_style.cpp b/src/html/m_style.cpp
index b2bcecfc80..6f0eb8d766 100644
--- a/src/html/m_style.cpp
+++ b/src/html/m_style.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp
index 2700bee9e0..d1abf09252 100644
--- a/src/html/m_tables.cpp
+++ b/src/html/m_tables.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp
index aeb866827a..e8cbb16fff 100644
--- a/src/html/winpars.cpp
+++ b/src/html/winpars.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "winpars.h"
 #endif
 
diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp
index d7126b0fcc..df6d37aa0e 100644
--- a/src/mgl/app.cpp
+++ b/src/mgl/app.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp
index 34183dd8a6..bef5fc7e40 100644
--- a/src/mgl/bitmap.cpp
+++ b/src/mgl/bitmap.cpp
@@ -6,7 +6,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bitmap.h"
 #endif
 
diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp
index 437a499948..8579529fc8 100644
--- a/src/mgl/brush.cpp
+++ b/src/mgl/brush.cpp
@@ -7,7 +7,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "brush.h"
 #endif
 
diff --git a/src/mgl/clipbrd.cpp b/src/mgl/clipbrd.cpp
index 2dc2f1924b..f7d2287510 100644
--- a/src/mgl/clipbrd.cpp
+++ b/src/mgl/clipbrd.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "clipbrd.h"
 #endif
 
diff --git a/src/mgl/colour.cpp b/src/mgl/colour.cpp
index affd84021d..26c01514a7 100644
--- a/src/mgl/colour.cpp
+++ b/src/mgl/colour.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp
index 0bb3bdac4a..3ec1a27da2 100644
--- a/src/mgl/cursor.cpp
+++ b/src/mgl/cursor.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp
index 410e1b4016..01930e0f34 100644
--- a/src/mgl/dc.cpp
+++ b/src/mgl/dc.cpp
@@ -16,7 +16,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
diff --git a/src/mgl/dcclient.cpp b/src/mgl/dcclient.cpp
index 4e05209e93..d238dbc95c 100644
--- a/src/mgl/dcclient.cpp
+++ b/src/mgl/dcclient.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcclient.h"
 #endif
 
diff --git a/src/mgl/dcmemory.cpp b/src/mgl/dcmemory.cpp
index c8818c2242..b782d5ed47 100644
--- a/src/mgl/dcmemory.cpp
+++ b/src/mgl/dcmemory.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcmemory.h"
 #endif
 
diff --git a/src/mgl/dcscreen.cpp b/src/mgl/dcscreen.cpp
index e3f77babb0..148ca94a29 100644
--- a/src/mgl/dcscreen.cpp
+++ b/src/mgl/dcscreen.cpp
@@ -6,7 +6,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
diff --git a/src/mgl/dirmgl.cpp b/src/mgl/dirmgl.cpp
index 62875935fe..e7c59d21b4 100644
--- a/src/mgl/dirmgl.cpp
+++ b/src/mgl/dirmgl.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dir.h"
 #endif
 
diff --git a/src/mgl/evtloop.cpp b/src/mgl/evtloop.cpp
index 95270cda46..d9fd929566 100644
--- a/src/mgl/evtloop.cpp
+++ b/src/mgl/evtloop.cpp
@@ -11,7 +11,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/mgl/font.cpp b/src/mgl/font.cpp
index e3ac9a29d2..d044a439ce 100644
--- a/src/mgl/font.cpp
+++ b/src/mgl/font.cpp
@@ -14,7 +14,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp
index 46386dfd99..fbba131e39 100644
--- a/src/mgl/fontenum.cpp
+++ b/src/mgl/fontenum.cpp
@@ -15,7 +15,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontenum.h"
 #endif
 
diff --git a/src/mgl/fontutil.cpp b/src/mgl/fontutil.cpp
index 2475cced8f..70970cb165 100644
--- a/src/mgl/fontutil.cpp
+++ b/src/mgl/fontutil.cpp
@@ -9,7 +9,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontutil.h"
 #endif
 
diff --git a/src/mgl/gdiobj.cpp b/src/mgl/gdiobj.cpp
index add0f6c1e9..62ec4bf06d 100644
--- a/src/mgl/gdiobj.cpp
+++ b/src/mgl/gdiobj.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/mgl/icon.cpp b/src/mgl/icon.cpp
index bd54a7001d..bedd19a32f 100644
--- a/src/mgl/icon.cpp
+++ b/src/mgl/icon.cpp
@@ -6,7 +6,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "icon.h"
 #endif
 
diff --git a/src/mgl/palette.cpp b/src/mgl/palette.cpp
index b851f799a8..efc4791921 100644
--- a/src/mgl/palette.cpp
+++ b/src/mgl/palette.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "palette.h"
 #endif
 
diff --git a/src/mgl/pen.cpp b/src/mgl/pen.cpp
index 863291bd9d..686e6d46db 100644
--- a/src/mgl/pen.cpp
+++ b/src/mgl/pen.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "pen.h"
 #endif
 
diff --git a/src/mgl/region.cpp b/src/mgl/region.cpp
index 2d80d07aa3..b7ba0b5c09 100644
--- a/src/mgl/region.cpp
+++ b/src/mgl/region.cpp
@@ -7,7 +7,7 @@
 // Licence:   wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "region.h"
 #endif
 
diff --git a/src/mgl/settings.cpp b/src/mgl/settings.cpp
index 355db0d4f6..76868a7369 100644
--- a/src/mgl/settings.cpp
+++ b/src/mgl/settings.cpp
@@ -7,7 +7,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settings.h"
 #endif
 
diff --git a/src/mgl/toplevel.cpp b/src/mgl/toplevel.cpp
index 2d23ae16d3..e75baca885 100644
--- a/src/mgl/toplevel.cpp
+++ b/src/mgl/toplevel.cpp
@@ -15,7 +15,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp
index 60b95bff99..7a545eb7fc 100644
--- a/src/mgl/window.cpp
+++ b/src/mgl/window.cpp
@@ -16,7 +16,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
diff --git a/src/motif/accel.cpp b/src/motif/accel.cpp
index 5ea448aec6..31a790d997 100644
--- a/src/motif/accel.cpp
+++ b/src/motif/accel.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "accel.h"
 #endif
 
diff --git a/src/motif/app.cpp b/src/motif/app.cpp
index 15e251c45c..0641c9878e 100644
--- a/src/motif/app.cpp
+++ b/src/motif/app.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
diff --git a/src/motif/bmpbuttn.cpp b/src/motif/bmpbuttn.cpp
index 4d3c21fa93..00da6290fa 100644
--- a/src/motif/bmpbuttn.cpp
+++ b/src/motif/bmpbuttn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bmpbuttn.h"
 #endif
 
diff --git a/src/motif/bmpmotif.cpp b/src/motif/bmpmotif.cpp
index 1ddb082650..2ceb292b7f 100644
--- a/src/motif/bmpmotif.cpp
+++ b/src/motif/bmpmotif.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bmpmotif.h"
 #endif
 
diff --git a/src/motif/button.cpp b/src/motif/button.cpp
index d56e59900e..8de8071092 100644
--- a/src/motif/button.cpp
+++ b/src/motif/button.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "button.h"
 #endif
 
diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp
index 144e2c47d1..927b508123 100644
--- a/src/motif/checkbox.cpp
+++ b/src/motif/checkbox.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checkbox.h"
 #endif
 
diff --git a/src/motif/checklst.cpp b/src/motif/checklst.cpp
index b86a9863bd..ef51031515 100644
--- a/src/motif/checklst.cpp
+++ b/src/motif/checklst.cpp
@@ -13,7 +13,7 @@
 // headers & declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checklst.h"
 #endif
 
diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp
index 37f3a967cf..233a0670e5 100644
--- a/src/motif/choice.cpp
+++ b/src/motif/choice.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "choice.h"
 #endif
 
diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp
index 1d067954ff..6d13b5b35c 100644
--- a/src/motif/clipbrd.cpp
+++ b/src/motif/clipbrd.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #pragma implementation "clipbrd.h"
 #endif
diff --git a/src/motif/colour.cpp b/src/motif/colour.cpp
index bd112d6a4a..c36d3b085c 100644
--- a/src/motif/colour.cpp
+++ b/src/motif/colour.cpp
@@ -12,7 +12,7 @@
 //// TODO: make wxColour a ref-counted object,
 //// so pixel values get shared.
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
diff --git a/src/motif/combobox.cpp b/src/motif/combobox.cpp
index 9cf68483e5..e4ec22c7da 100644
--- a/src/motif/combobox.cpp
+++ b/src/motif/combobox.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "combobox.h"
 #endif
 
diff --git a/src/motif/control.cpp b/src/motif/control.cpp
index e488c043aa..c972668ad1 100644
--- a/src/motif/control.cpp
+++ b/src/motif/control.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "control.h"
 #endif
 
diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp
index 4ecaddf1b7..dfcb9fbbc1 100644
--- a/src/motif/cursor.cpp
+++ b/src/motif/cursor.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp
index 9a21179091..debae5252f 100644
--- a/src/motif/dataobj.cpp
+++ b/src/motif/dataobj.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dataobj.h"
 #endif
 
diff --git a/src/motif/dc.cpp b/src/motif/dc.cpp
index cc5c5359a4..9eacd3404f 100644
--- a/src/motif/dc.cpp
+++ b/src/motif/dc.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp
index 1211436700..914b32f18b 100644
--- a/src/motif/dcclient.cpp
+++ b/src/motif/dcclient.cpp
@@ -36,7 +36,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcclient.h"
 #endif
 
diff --git a/src/motif/dcmemory.cpp b/src/motif/dcmemory.cpp
index 451576cf5e..3dd666c700 100644
--- a/src/motif/dcmemory.cpp
+++ b/src/motif/dcmemory.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcmemory.h"
 #endif
 
diff --git a/src/motif/dcscreen.cpp b/src/motif/dcscreen.cpp
index 1da45d5e39..62d1cbc8b8 100644
--- a/src/motif/dcscreen.cpp
+++ b/src/motif/dcscreen.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp
index a9a273a5f1..393429dc1f 100644
--- a/src/motif/dialog.cpp
+++ b/src/motif/dialog.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dialog.h"
 #endif
 
diff --git a/src/motif/dnd.cpp b/src/motif/dnd.cpp
index f4a9cefec7..9ed4df67e6 100644
--- a/src/motif/dnd.cpp
+++ b/src/motif/dnd.cpp
@@ -7,7 +7,7 @@
 // Licence:   	wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dnd.h"
 #endif
 
diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp
index 94f636eebf..f0f1d779dc 100644
--- a/src/motif/evtloop.cpp
+++ b/src/motif/evtloop.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp
index ac572e1312..bcf6784fca 100644
--- a/src/motif/filedlg.cpp
+++ b/src/motif/filedlg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "filedlg.h"
 #endif
 
diff --git a/src/motif/font.cpp b/src/motif/font.cpp
index dd3de8f55a..c4c0f9fcd6 100644
--- a/src/motif/font.cpp
+++ b/src/motif/font.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp
index ea10fe2554..061c5a675b 100644
--- a/src/motif/frame.cpp
+++ b/src/motif/frame.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "frame.h"
 #endif
 
diff --git a/src/motif/gauge.cpp b/src/motif/gauge.cpp
index 23931f09d9..4ab115b8a6 100644
--- a/src/motif/gauge.cpp
+++ b/src/motif/gauge.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gauge.h"
 #endif
 
diff --git a/src/motif/gdiobj.cpp b/src/motif/gdiobj.cpp
index 63613b5727..89a00f8370 100644
--- a/src/motif/gdiobj.cpp
+++ b/src/motif/gdiobj.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/motif/glcanvas.cpp b/src/motif/glcanvas.cpp
index bf6347593a..65f2f0526c 100644
--- a/src/motif/glcanvas.cpp
+++ b/src/motif/glcanvas.cpp
@@ -10,7 +10,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "glcanvas.h"
 #endif
 
diff --git a/src/motif/icon.cpp b/src/motif/icon.cpp
index e8316d4b9d..692175a812 100644
--- a/src/motif/icon.cpp
+++ b/src/motif/icon.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "icon.h"
 #endif
 
diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp
index e28473f615..9908f10c23 100644
--- a/src/motif/listbox.cpp
+++ b/src/motif/listbox.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listbox.h"
 #endif
 
diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp
index c4ad44a11a..87a201a0e2 100644
--- a/src/motif/mdi.cpp
+++ b/src/motif/mdi.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "mdi.h"
 #endif
 
diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp
index c0ab807012..79c8ab5061 100644
--- a/src/motif/menu.cpp
+++ b/src/motif/menu.cpp
@@ -14,7 +14,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menu.h"
 #endif
 
diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp
index 6283b0bb93..b2cd3c4496 100644
--- a/src/motif/menuitem.cpp
+++ b/src/motif/menuitem.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menuitem.h"
 #endif
 
diff --git a/src/motif/minifram.cpp b/src/motif/minifram.cpp
index 1161e3de57..50524f2452 100644
--- a/src/motif/minifram.cpp
+++ b/src/motif/minifram.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "minifram.h"
 #endif
 
diff --git a/src/motif/msgdlg.cpp b/src/motif/msgdlg.cpp
index caf660584d..cbc30128a0 100644
--- a/src/motif/msgdlg.cpp
+++ b/src/motif/msgdlg.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "msgdlg.h"
 #endif
 
diff --git a/src/motif/palette.cpp b/src/motif/palette.cpp
index 48368b8e34..ff67a7ff33 100644
--- a/src/motif/palette.cpp
+++ b/src/motif/palette.cpp
@@ -34,7 +34,7 @@ recommended; only the window manager should do this...  Also, it is
 not the functionality that wxPalette::Create() aims to provide.
  */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "palette.h"
 #endif
 
diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp
index 9bf78c04a4..365fe2b336 100644
--- a/src/motif/radiobox.cpp
+++ b/src/motif/radiobox.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobox.h"
 #endif
 
diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp
index cedc3277b6..a2f222dd0b 100644
--- a/src/motif/radiobut.cpp
+++ b/src/motif/radiobut.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobut.h"
 #endif
 
diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp
index 26909cacb2..ff018e26b2 100644
--- a/src/motif/scrolbar.cpp
+++ b/src/motif/scrolbar.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "scrolbar.h"
 #endif
 
diff --git a/src/motif/settings.cpp b/src/motif/settings.cpp
index 91f8fc631b..b332b632c7 100644
--- a/src/motif/settings.cpp
+++ b/src/motif/settings.cpp
@@ -13,7 +13,7 @@
 // per-user file, which can be edited using a Windows-control-panel clone.
 // Also they should be documented better. Some are very MS Windows-ish.
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settings.h"
 #endif
 
diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp
index 69d6efb92c..c0eee32152 100644
--- a/src/motif/slider.cpp
+++ b/src/motif/slider.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slider.h"
 #endif
 
diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp
index 4263105156..ec039edb0c 100644
--- a/src/motif/spinbutt.cpp
+++ b/src/motif/spinbutt.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinbutt.h"
 #endif
 
diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp
index 72a813f396..1226a83f61 100644
--- a/src/motif/statbmp.cpp
+++ b/src/motif/statbmp.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbmp.h"
 #endif
 
diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp
index 3aad265153..0c3d210a5e 100644
--- a/src/motif/statbox.cpp
+++ b/src/motif/statbox.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbox.h"
 #endif
 
diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp
index bbfd843ca0..b0cd4e5c74 100644
--- a/src/motif/stattext.cpp
+++ b/src/motif/stattext.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "stattext.h"
 #endif
 
diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp
index cb5b2b49a9..0177cb2b2f 100644
--- a/src/motif/textctrl.cpp
+++ b/src/motif/textctrl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textctrl.h"
 #endif
 
diff --git a/src/motif/timer.cpp b/src/motif/timer.cpp
index 570e4186f9..fdc59712e6 100644
--- a/src/motif/timer.cpp
+++ b/src/motif/timer.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "timer.h"
 #endif
 
diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp
index 173e6a9756..4078d2eefe 100644
--- a/src/motif/toolbar.cpp
+++ b/src/motif/toolbar.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toolbar.h"
 #endif
 
diff --git a/src/motif/toplevel.cpp b/src/motif/toplevel.cpp
index 9ce63d5fd6..5f2891a4e5 100644
--- a/src/motif/toplevel.cpp
+++ b/src/motif/toplevel.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
diff --git a/src/motif/window.cpp b/src/motif/window.cpp
index acca11e6c1..0a70d435a5 100644
--- a/src/motif/window.cpp
+++ b/src/motif/window.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp
index 66414b01a4..563ce9929c 100644
--- a/src/msw/accel.cpp
+++ b/src/msw/accel.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "accel.h"
 #endif
 
diff --git a/src/msw/app.cpp b/src/msw/app.cpp
index 24768fe1a5..e553e03534 100644
--- a/src/msw/app.cpp
+++ b/src/msw/app.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp
index 8be40253f6..bcf8a618f0 100644
--- a/src/msw/bitmap.cpp
+++ b/src/msw/bitmap.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "bitmap.h"
 #endif
 
diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp
index 7ff6769e77..aadb873906 100644
--- a/src/msw/bmpbuttn.cpp
+++ b/src/msw/bmpbuttn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bmpbuttn.h"
 #endif
 
diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp
index f1109f4633..4fc8fb3b65 100644
--- a/src/msw/brush.cpp
+++ b/src/msw/brush.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "brush.h"
 #endif
 
diff --git a/src/msw/button.cpp b/src/msw/button.cpp
index 34b8445f00..9a36d74f46 100644
--- a/src/msw/button.cpp
+++ b/src/msw/button.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "button.h"
 #endif
 
diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp
index dac2949001..63fc43ac08 100644
--- a/src/msw/caret.cpp
+++ b/src/msw/caret.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "caret.h"
 #endif
 
diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp
index dfc0c6baad..ce3d9ceadd 100644
--- a/src/msw/checkbox.cpp
+++ b/src/msw/checkbox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "checkbox.h"
 #endif
 
diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp
index 90bf234dc1..b31e46e999 100644
--- a/src/msw/checklst.cpp
+++ b/src/msw/checklst.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "checklst.h"
 #endif
 
diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp
index 57631408b6..bf8abfcb42 100644
--- a/src/msw/choice.cpp
+++ b/src/msw/choice.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "choice.h"
 #endif
 
diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp
index 3bd80dd069..7802a92ac8 100644
--- a/src/msw/clipbrd.cpp
+++ b/src/msw/clipbrd.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "clipbrd.h"
 #endif
 
diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp
index e3a124210c..66af5ffcf7 100644
--- a/src/msw/colordlg.cpp
+++ b/src/msw/colordlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "colordlg.h"
 #endif
 
diff --git a/src/msw/colour.cpp b/src/msw/colour.cpp
index 7ea51be97c..10a4ece72d 100644
--- a/src/msw/colour.cpp
+++ b/src/msw/colour.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp
index 402acea13e..1c62aa80f3 100644
--- a/src/msw/combobox.cpp
+++ b/src/msw/combobox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "combobox.h"
 #endif
 
diff --git a/src/msw/control.cpp b/src/msw/control.cpp
index 81f642c81c..b265d56be0 100644
--- a/src/msw/control.cpp
+++ b/src/msw/control.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "control.h"
 #endif
 
diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp
index 221c3a3bf6..2478d85df1 100644
--- a/src/msw/cursor.cpp
+++ b/src/msw/cursor.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "cursor.h"
 #endif
 
diff --git a/src/msw/data.cpp b/src/msw/data.cpp
index 0c901a15fa..04abb7f531 100644
--- a/src/msw/data.cpp
+++ b/src/msw/data.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "data.h"
 #endif
 
diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp
index 52e247fce2..914bfa6fb3 100644
--- a/src/msw/dc.cpp
+++ b/src/msw/dc.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp
index 77bc59c15c..800f91fb94 100644
--- a/src/msw/dcclient.cpp
+++ b/src/msw/dcclient.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcclient.h"
 #endif
 
diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp
index ea4c0c90e6..3427da41a1 100644
--- a/src/msw/dcmemory.cpp
+++ b/src/msw/dcmemory.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcmemory.h"
 #endif
 
diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp
index c0f9a2c097..1d6fad9051 100644
--- a/src/msw/dcprint.cpp
+++ b/src/msw/dcprint.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcprint.h"
 #endif
 
diff --git a/src/msw/dcscreen.cpp b/src/msw/dcscreen.cpp
index 53cc7c826a..a6f3948d1b 100644
--- a/src/msw/dcscreen.cpp
+++ b/src/msw/dcscreen.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp
index 28147375dd..1ddd1a726d 100644
--- a/src/msw/dde.cpp
+++ b/src/msw/dde.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dde.h"
 #endif
 
diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp
index c26ab68062..b7ccfaf0d6 100644
--- a/src/msw/dialog.cpp
+++ b/src/msw/dialog.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dialog.h"
 #endif
 
diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp
index 514c4c3c89..156147b0ae 100644
--- a/src/msw/dir.cpp
+++ b/src/msw/dir.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dir.h"
 #endif
 
diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp
index 5f9006fa2b..e168dad0a1 100644
--- a/src/msw/dirdlg.cpp
+++ b/src/msw/dirdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dirdlg.h"
 #endif
 
diff --git a/src/msw/display.cpp b/src/msw/display.cpp
index ecb46d2913..fc25e3f476 100644
--- a/src/msw/display.cpp
+++ b/src/msw/display.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "display.h"
 #endif
 
diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp
index 1d88dfca55..de1e7b088e 100644
--- a/src/msw/dragimag.cpp
+++ b/src/msw/dragimag.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dragimag.h"
 #endif
 
diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp
index e470b3254b..73c04b84db 100644
--- a/src/msw/enhmeta.cpp
+++ b/src/msw/enhmeta.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "enhmeta.h"
 #endif
 
diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp
index 86ad5ac4b8..94874f5da1 100644
--- a/src/msw/evtloop.cpp
+++ b/src/msw/evtloop.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp
index 76c85f3c8a..7c533fb4a3 100644
--- a/src/msw/fdrepdlg.cpp
+++ b/src/msw/fdrepdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mswfdrepdlg.h"
 #endif
 
diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp
index ba52c18fcc..52ea324076 100644
--- a/src/msw/filedlg.cpp
+++ b/src/msw/filedlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "filedlg.h"
 #endif
 
diff --git a/src/msw/font.cpp b/src/msw/font.cpp
index ad1c6ae5b3..45a5473ca9 100644
--- a/src/msw/font.cpp
+++ b/src/msw/font.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp
index 34ff09c2dd..ee3382628c 100644
--- a/src/msw/fontdlg.cpp
+++ b/src/msw/fontdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontdlg.h"
 #endif
 
diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp
index c732ae5693..cc320215b8 100644
--- a/src/msw/fontenum.cpp
+++ b/src/msw/fontenum.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontenum.h"
 #endif
 
diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp
index dfee03efee..1bff1940f7 100644
--- a/src/msw/fontutil.cpp
+++ b/src/msw/fontutil.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontutil.h"
 #endif
 
diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp
index 96f74340ea..7a94e8db1a 100644
--- a/src/msw/frame.cpp
+++ b/src/msw/frame.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "frame.h"
 #endif
 
diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp
index fa515196ac..7d082b81b4 100644
--- a/src/msw/gauge95.cpp
+++ b/src/msw/gauge95.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gauge95.h"
 #endif
 
diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp
index 9ac518a065..2e6ae1b7f5 100644
--- a/src/msw/gdiimage.cpp
+++ b/src/msw/gdiimage.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gdiimage.h"
 #endif
 
diff --git a/src/msw/gdiobj.cpp b/src/msw/gdiobj.cpp
index 8a2e9e16fa..de94cd9d54 100644
--- a/src/msw/gdiobj.cpp
+++ b/src/msw/gdiobj.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp
index 3735184352..f854b48a7e 100644
--- a/src/msw/glcanvas.cpp
+++ b/src/msw/glcanvas.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "glcanvas.h"
 #endif
 
diff --git a/src/msw/helpbest.cpp b/src/msw/helpbest.cpp
index 6fb956a0d7..be1e404cde 100644
--- a/src/msw/helpbest.cpp
+++ b/src/msw/helpbest.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpbest.h"
 #endif
 
diff --git a/src/msw/helpchm.cpp b/src/msw/helpchm.cpp
index ff0459bd6f..902829aca0 100644
--- a/src/msw/helpchm.cpp
+++ b/src/msw/helpchm.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "helpchm.h"
 #endif
 
diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp
index cdcaa37628..b2d5613556 100644
--- a/src/msw/helpwin.cpp
+++ b/src/msw/helpwin.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpwin.h"
 #endif
 
diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp
index 6a7783ebf5..9064101a53 100644
--- a/src/msw/icon.cpp
+++ b/src/msw/icon.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "icon.h"
 #endif
 
diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp
index 342b7da070..c31e18afbe 100644
--- a/src/msw/imaglist.cpp
+++ b/src/msw/imaglist.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "imaglist.h"
 #endif
 
diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp
index 9200b5263d..f774bc97da 100644
--- a/src/msw/iniconf.cpp
+++ b/src/msw/iniconf.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "iniconf.h"
 #endif
 
diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp
index eb5ea63c87..ac154cde1b 100644
--- a/src/msw/joystick.cpp
+++ b/src/msw/joystick.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "joystick.h"
 #endif
 
diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp
index f54a04bd96..b587d32dba 100644
--- a/src/msw/listbox.cpp
+++ b/src/msw/listbox.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listbox.h"
 #endif
 
diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp
index 8c73f562c4..7b53b1d844 100644
--- a/src/msw/listctrl.cpp
+++ b/src/msw/listctrl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listctrl.h"
     #pragma implementation "listctrlbase.h"
 #endif
diff --git a/src/msw/main.cpp b/src/msw/main.cpp
index c293e7c511..1fd175519f 100644
--- a/src/msw/main.cpp
+++ b/src/msw/main.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation
 #endif
 
diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp
index c50af44242..2a7c8f717a 100644
--- a/src/msw/mdi.cpp
+++ b/src/msw/mdi.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mdi.h"
 #endif
 
diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp
index 5b60b5d6a3..6f1343b30c 100644
--- a/src/msw/menu.cpp
+++ b/src/msw/menu.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menu.h"
 #endif
 
diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp
index e8f1c41df9..09ef0d039f 100644
--- a/src/msw/menuitem.cpp
+++ b/src/msw/menuitem.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menuitem.h"
 #endif
 
diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp
index d9242661f8..57a7baf9db 100644
--- a/src/msw/metafile.cpp
+++ b/src/msw/metafile.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "metafile.h"
 #endif
 
diff --git a/src/msw/microwin.c b/src/msw/microwin.c
index 3921366efc..cdee637987 100644
--- a/src/msw/microwin.c
+++ b/src/msw/microwin.c
@@ -11,7 +11,7 @@
 
 */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "microwin.h"
 #endif
 
diff --git a/src/msw/minifram.cpp b/src/msw/minifram.cpp
index f32bd94755..5180dd713d 100644
--- a/src/msw/minifram.cpp
+++ b/src/msw/minifram.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "minifram.h"
 #endif
 
diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp
index 3b5517b828..c51438155d 100644
--- a/src/msw/msgdlg.cpp
+++ b/src/msw/msgdlg.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "msgdlg.h"
 #endif
 
diff --git a/src/msw/mslu.cpp b/src/msw/mslu.cpp
index 354a88b649..eb7866d90c 100644
--- a/src/msw/mslu.cpp
+++ b/src/msw/mslu.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp
index ed6efcdd49..313e17943d 100644
--- a/src/msw/nativdlg.cpp
+++ b/src/msw/nativdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation
 #endif
 
diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp
index cb9d37a573..37ae63235e 100644
--- a/src/msw/notebook.cpp
+++ b/src/msw/notebook.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "notebook.h"
 #endif
 
diff --git a/src/msw/ole/access.cpp b/src/msw/ole/access.cpp
index 62e8024db4..22251ebae9 100644
--- a/src/msw/ole/access.cpp
+++ b/src/msw/ole/access.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "access.h"
 #endif
 
diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp
index 095c6e0119..81827a79ef 100644
--- a/src/msw/ole/automtn.cpp
+++ b/src/msw/ole/automtn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "automtn.h"
 #endif
 
diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp
index 1f2df6cdb2..085fd66a8a 100644
--- a/src/msw/ole/dataobj.cpp
+++ b/src/msw/ole/dataobj.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dataobj.h"
 #endif
 
diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp
index c0ea443752..7972450bd2 100644
--- a/src/msw/ole/dropsrc.cpp
+++ b/src/msw/ole/dropsrc.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma implementation "dropsrc.h"
 #endif
 
diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp
index 759dc6ba81..46da03329d 100644
--- a/src/msw/ole/droptgt.cpp
+++ b/src/msw/ole/droptgt.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "droptgt.h"
 #endif
 
diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp
index c54de1c5d9..c8ce51a5b7 100644
--- a/src/msw/ole/oleutils.cpp
+++ b/src/msw/ole/oleutils.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "oleutils.h"
 #endif
 
diff --git a/src/msw/ole/uuid.cpp b/src/msw/ole/uuid.cpp
index cdcbe66714..87bdd0cc08 100644
--- a/src/msw/ole/uuid.cpp
+++ b/src/msw/ole/uuid.cpp
@@ -13,7 +13,7 @@
 // Declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "uuid.h"
 #endif
 
diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp
index 602bfd02ff..665acc4c9d 100644
--- a/src/msw/ownerdrw.cpp
+++ b/src/msw/ownerdrw.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp
index a7828cb1ef..40573ae148 100644
--- a/src/msw/palette.cpp
+++ b/src/msw/palette.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "palette.h"
 #endif
 
diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp
index 959a6dc44d..90faa37833 100644
--- a/src/msw/pen.cpp
+++ b/src/msw/pen.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "pen.h"
 #endif
 
diff --git a/src/msw/penwin.cpp b/src/msw/penwin.cpp
index fa0a52aa32..afb20dc16f 100644
--- a/src/msw/penwin.cpp
+++ b/src/msw/penwin.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #endif
 
diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp
index b47741145c..f19637098b 100644
--- a/src/msw/popupwin.cpp
+++ b/src/msw/popupwin.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "popup.h"
 #endif
 
diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp
index 380233da94..1abcb390c8 100644
--- a/src/msw/printdlg.cpp
+++ b/src/msw/printdlg.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "printdlg.h"
 #endif
 
diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp
index 36691904cc..34ce8201a4 100644
--- a/src/msw/printwin.cpp
+++ b/src/msw/printwin.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "printwin.h"
 #endif
 
diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp
index 39e4d068f6..19ae0e3b05 100644
--- a/src/msw/radiobox.cpp
+++ b/src/msw/radiobox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "radiobox.h"
 #endif
 
diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp
index 4b51cbc2d8..aa19342b60 100644
--- a/src/msw/radiobut.cpp
+++ b/src/msw/radiobut.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobut.h"
 #endif
 
diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp
index 2a5325bc15..c7b7a470e6 100644
--- a/src/msw/regconf.cpp
+++ b/src/msw/regconf.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "regconf.h"
 #endif
 
diff --git a/src/msw/region.cpp b/src/msw/region.cpp
index e6651489cc..4ff31ef0f7 100644
--- a/src/msw/region.cpp
+++ b/src/msw/region.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "region.h"
 #endif
 
diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp
index c18f1de8d4..8305c63eb8 100644
--- a/src/msw/registry.cpp
+++ b/src/msw/registry.cpp
@@ -12,7 +12,7 @@
 //              - add high level functions (RegisterOleServer, ...)
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "registry.h"
 #endif
 
diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp
index 739bf843cc..14e71a1711 100644
--- a/src/msw/scrolbar.cpp
+++ b/src/msw/scrolbar.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "scrolbar.h"
 #endif
 
diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp
index 2f35fc9e19..041527b0b1 100644
--- a/src/msw/slider95.cpp
+++ b/src/msw/slider95.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slider95.h"
 #endif
 
diff --git a/src/msw/slidrmsw.cpp b/src/msw/slidrmsw.cpp
index 3a776160ab..48cfaf922a 100644
--- a/src/msw/slidrmsw.cpp
+++ b/src/msw/slidrmsw.cpp
@@ -9,7 +9,7 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slidrmsw.h"
 #endif
 
diff --git a/src/msw/snglinst.cpp b/src/msw/snglinst.cpp
index bf43276566..b3f621b44d 100644
--- a/src/msw/snglinst.cpp
+++ b/src/msw/snglinst.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "snglinst.h"
 #endif
 
diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp
index ff06c69136..59f2672186 100644
--- a/src/msw/spinbutt.cpp
+++ b/src/msw/spinbutt.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinbutt.h"
     #pragma implementation "spinbutbase.h"
 #endif
diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp
index c1aa0182d7..9f0d79c82e 100644
--- a/src/msw/spinctrl.cpp
+++ b/src/msw/spinctrl.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinctrlbase.h"
     #pragma implementation "spinctrl.h"
 #endif
diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp
index 604f6be4e0..a2a8698bfb 100644
--- a/src/msw/statbmp.cpp
+++ b/src/msw/statbmp.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statbmp.h"
 #endif
 
diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp
index 6c89c3d1d7..40a44c133f 100644
--- a/src/msw/statbox.cpp
+++ b/src/msw/statbox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statbox.h"
 #endif
 
diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp
index 2687370ef4..058f3b6f35 100644
--- a/src/msw/statbr95.cpp
+++ b/src/msw/statbr95.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "statbr95.h"
 #endif
 
diff --git a/src/msw/statline.cpp b/src/msw/statline.cpp
index a86e0ad0a6..ea49fcdcbb 100644
--- a/src/msw/statline.cpp
+++ b/src/msw/statline.cpp
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statline.h"
 #endif
 
diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp
index 4c2521c468..0c89b20693 100644
--- a/src/msw/stattext.cpp
+++ b/src/msw/stattext.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "stattext.h"
 #endif
 
diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp
index 4f3e3ab4c0..e203c09ffd 100644
--- a/src/msw/tabctrl.cpp
+++ b/src/msw/tabctrl.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "tabctrl.h"
 #endif
 
diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp
index cc2b9bc9c5..482ca24c4a 100644
--- a/src/msw/taskbar.cpp
+++ b/src/msw/taskbar.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "taskbar.h"
 #endif
 
diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp
index 94305d7af8..9e3c54c9d2 100644
--- a/src/msw/tbar95.cpp
+++ b/src/msw/tbar95.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbar95.h"
 #endif
 
diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp
index d166b81736..f558a94b80 100644
--- a/src/msw/tbarmsw.cpp
+++ b/src/msw/tbarmsw.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbarmsw.h"
 #endif
 
diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp
index 1a4228d9a4..bdd65a6ad1 100644
--- a/src/msw/textctrl.cpp
+++ b/src/msw/textctrl.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "textctrl.h"
 #endif
 
diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp
index 46719dc9c2..7c66077a99 100644
--- a/src/msw/thread.cpp
+++ b/src/msw/thread.cpp
@@ -10,7 +10,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "thread.h"
 #endif
 
diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp
index 2c9f4d79e3..64096f7d77 100644
--- a/src/msw/timer.cpp
+++ b/src/msw/timer.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "timer.h"
 #endif
 
diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp
index a59da317ab..7772899d1b 100644
--- a/src/msw/toplevel.cpp
+++ b/src/msw/toplevel.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp
index 2be2afb6c6..01d8198285 100644
--- a/src/msw/treectrl.cpp
+++ b/src/msw/treectrl.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "treectrl.h"
 #endif
 
diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp
index 4e9958f801..f1408c299e 100644
--- a/src/msw/utilsexc.cpp
+++ b/src/msw/utilsexc.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation
 #endif
 
diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp
index f2155c45f7..40a4195f6e 100644
--- a/src/msw/uxtheme.cpp
+++ b/src/msw/uxtheme.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "uxtheme.h"
 #endif
 
diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp
index 97723420c3..2b4f329138 100644
--- a/src/msw/volume.cpp
+++ b/src/msw/volume.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fsvolume.h"
 #endif
 
diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp
index 610ef77cef..1ee0083801 100644
--- a/src/msw/wave.cpp
+++ b/src/msw/wave.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "wave.h"
 #endif
 
diff --git a/src/msw/wince/filedlgwce.cpp b/src/msw/wince/filedlgwce.cpp
index 218f15e5dc..f8fde83eb4 100644
--- a/src/msw/wince/filedlgwce.cpp
+++ b/src/msw/wince/filedlgwce.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "filedlg.h"
 #endif
 
diff --git a/src/msw/wince/helpwce.cpp b/src/msw/wince/helpwce.cpp
index 89bd93bb30..72154634e4 100644
--- a/src/msw/wince/helpwce.cpp
+++ b/src/msw/wince/helpwce.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "helpwce.h"
 #endif
 
diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp
index 0a67090e9e..22cd6ffe97 100644
--- a/src/msw/wince/tbarwce.cpp
+++ b/src/msw/wince/tbarwce.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbarwce.h"
 #endif
 
diff --git a/src/msw/wince/time.cpp b/src/msw/wince/time.cpp
index 9f1c570d10..d9657f7051 100644
--- a/src/msw/wince/time.cpp
+++ b/src/msw/wince/time.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index c8efb9e912..a957b5e8c0 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
diff --git a/src/univ/bmpbuttn.cpp b/src/univ/bmpbuttn.cpp
index 9c6227c33d..396dc3040a 100644
--- a/src/univ/bmpbuttn.cpp
+++ b/src/univ/bmpbuttn.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univbmpbuttn.h"
 #endif
 
diff --git a/src/univ/button.cpp b/src/univ/button.cpp
index f76b62d678..fb7914d2a1 100644
--- a/src/univ/button.cpp
+++ b/src/univ/button.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univbutton.h"
 #endif
 
diff --git a/src/univ/checkbox.cpp b/src/univ/checkbox.cpp
index 2fcd04bfa9..e80d036343 100644
--- a/src/univ/checkbox.cpp
+++ b/src/univ/checkbox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univcheckbox.h"
 #endif
 
diff --git a/src/univ/checklst.cpp b/src/univ/checklst.cpp
index 347c3766f7..8f3981f8c4 100644
--- a/src/univ/checklst.cpp
+++ b/src/univ/checklst.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univchecklst.h"
 #endif
 
diff --git a/src/univ/choice.cpp b/src/univ/choice.cpp
index 2997ac532c..81925542a1 100644
--- a/src/univ/choice.cpp
+++ b/src/univ/choice.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univchoice.h"
 #endif
 
diff --git a/src/univ/colschem.cpp b/src/univ/colschem.cpp
index 8ab2d2078a..49975d709c 100644
--- a/src/univ/colschem.cpp
+++ b/src/univ/colschem.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "colschem.h"
 #endif
 
diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp
index 2ee283fb93..f373cc128f 100644
--- a/src/univ/combobox.cpp
+++ b/src/univ/combobox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univcombobox.h"
 #endif
 
diff --git a/src/univ/control.cpp b/src/univ/control.cpp
index 89d9065e01..712ccbb4c0 100644
--- a/src/univ/control.cpp
+++ b/src/univ/control.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "control.h"
 #endif
 
diff --git a/src/univ/ctrlrend.cpp b/src/univ/ctrlrend.cpp
index e7d9480a6b..a3fb8739bc 100644
--- a/src/univ/ctrlrend.cpp
+++ b/src/univ/ctrlrend.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "renderer.h"
 #endif
 
diff --git a/src/univ/dialog.cpp b/src/univ/dialog.cpp
index e109f3df11..40b3f7efe8 100644
--- a/src/univ/dialog.cpp
+++ b/src/univ/dialog.cpp
@@ -14,7 +14,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univdialog.h"
 #endif
 
diff --git a/src/univ/framuniv.cpp b/src/univ/framuniv.cpp
index d4c06aa36b..1fa17e7a06 100644
--- a/src/univ/framuniv.cpp
+++ b/src/univ/framuniv.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univframe.h"
 #endif
 
diff --git a/src/univ/gauge.cpp b/src/univ/gauge.cpp
index 3b8f7c8ed6..c8ebbb2289 100644
--- a/src/univ/gauge.cpp
+++ b/src/univ/gauge.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "gaugeuniv.h"
 #endif
 
diff --git a/src/univ/inpcons.cpp b/src/univ/inpcons.cpp
index 8fb83fff49..af38f0c8eb 100644
--- a/src/univ/inpcons.cpp
+++ b/src/univ/inpcons.cpp
@@ -13,7 +13,7 @@
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "inpcons.h"
 #endif
 
diff --git a/src/univ/inphand.cpp b/src/univ/inphand.cpp
index 92764b60eb..73357762fb 100644
--- a/src/univ/inphand.cpp
+++ b/src/univ/inphand.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "inphand.h"
 #endif
 
diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp
index 299255d2b8..84cd3a79a1 100644
--- a/src/univ/listbox.cpp
+++ b/src/univ/listbox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univlistbox.h"
 #endif
 
diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp
index a71678454b..ae3880336b 100644
--- a/src/univ/menu.cpp
+++ b/src/univ/menu.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univmenuitem.h"
     #pragma implementation "univmenu.h"
 #endif
diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp
index 9e5116fe85..26916b958d 100644
--- a/src/univ/notebook.cpp
+++ b/src/univ/notebook.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univnotebook.h"
 #endif
 
diff --git a/src/univ/radiobox.cpp b/src/univ/radiobox.cpp
index 5c434fa20b..fcbadbd566 100644
--- a/src/univ/radiobox.cpp
+++ b/src/univ/radiobox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univradiobox.h"
 #endif
 
diff --git a/src/univ/radiobut.cpp b/src/univ/radiobut.cpp
index eb1d8a6dc8..6ba669f940 100644
--- a/src/univ/radiobut.cpp
+++ b/src/univ/radiobut.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univradiobut.h"
 #endif
 
diff --git a/src/univ/scrarrow.cpp b/src/univ/scrarrow.cpp
index 48d669cf0d..83ae91fe15 100644
--- a/src/univ/scrarrow.cpp
+++ b/src/univ/scrarrow.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univscrarrow.h"
 #endif
 
diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp
index 061fabdd8b..3873aed615 100644
--- a/src/univ/scrolbar.cpp
+++ b/src/univ/scrolbar.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univscrolbar.h"
 #endif
 
diff --git a/src/univ/scrthumb.cpp b/src/univ/scrthumb.cpp
index ef2d2954f2..9e8b411062 100644
--- a/src/univ/scrthumb.cpp
+++ b/src/univ/scrthumb.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univscrthumb.h"
 #endif
 
diff --git a/src/univ/slider.cpp b/src/univ/slider.cpp
index 87064fda1d..e86aa02f8a 100644
--- a/src/univ/slider.cpp
+++ b/src/univ/slider.cpp
@@ -42,7 +42,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univslider.h"
 #endif
 
diff --git a/src/univ/spinbutt.cpp b/src/univ/spinbutt.cpp
index 08edc83639..a9428daa30 100644
--- a/src/univ/spinbutt.cpp
+++ b/src/univ/spinbutt.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "spinbutt.h"
     #pragma implementation "univspinbutt.h"
 #endif
diff --git a/src/univ/statbmp.cpp b/src/univ/statbmp.cpp
index 8d51038431..32bb836f7d 100644
--- a/src/univ/statbmp.cpp
+++ b/src/univ/statbmp.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univstatbmp.h"
 #endif
 
diff --git a/src/univ/statbox.cpp b/src/univ/statbox.cpp
index 1024db8125..e1df45fb23 100644
--- a/src/univ/statbox.cpp
+++ b/src/univ/statbox.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univstatbox.h"
 #endif
 
diff --git a/src/univ/statline.cpp b/src/univ/statline.cpp
index 2eee48c214..a4527c4017 100644
--- a/src/univ/statline.cpp
+++ b/src/univ/statline.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univstatline.h"
 #endif
 
diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp
index 8521014b48..2f2a955f83 100644
--- a/src/univ/stattext.cpp
+++ b/src/univ/stattext.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univstattext.h"
 #endif
 
diff --git a/src/univ/statusbr.cpp b/src/univ/statusbr.cpp
index 2cd0e48d45..6e775a60fc 100644
--- a/src/univ/statusbr.cpp
+++ b/src/univ/statusbr.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univstatusbr.h"
 #endif
 
diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp
index 78e4f2a3cc..6e28cbd26c 100644
--- a/src/univ/textctrl.cpp
+++ b/src/univ/textctrl.cpp
@@ -117,7 +117,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univtextctrl.h"
 #endif
 
diff --git a/src/univ/theme.cpp b/src/univ/theme.cpp
index f20dbf3eb4..1ed1f57a20 100644
--- a/src/univ/theme.cpp
+++ b/src/univ/theme.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "theme.h"
 #endif
 
diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp
index f4cf7740fa..c0eea0ba8b 100644
--- a/src/univ/toolbar.cpp
+++ b/src/univ/toolbar.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univtoolbar.h"
 #endif
 
diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp
index b3c6585e3e..f1dae67cb3 100644
--- a/src/univ/topluniv.cpp
+++ b/src/univ/topluniv.cpp
@@ -14,7 +14,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univtoplevel.h"
 #endif
 
diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp
index e569871c40..cb89cc06f7 100644
--- a/src/univ/winuniv.cpp
+++ b/src/univ/winuniv.cpp
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univwindow.h"
 #endif
 
diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp
index f0bb49e961..6520b2edf8 100644
--- a/src/unix/dialup.cpp
+++ b/src/unix/dialup.cpp
@@ -9,12 +9,15 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "wx/setup.h"
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #   pragma implementation "dialup.h"
 #endif
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/setup.h"
+
 #if wxUSE_DIALUP_MANAGER
 
 #ifndef  WX_PRECOMP
diff --git a/src/unix/dir.cpp b/src/unix/dir.cpp
index deab1bee7f..c75d2712a4 100644
--- a/src/unix/dir.cpp
+++ b/src/unix/dir.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dir.h"
 #endif
 
diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp
index 78a1656812..aae5896769 100644
--- a/src/unix/displayx11.cpp
+++ b/src/unix/displayx11.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "display.h"
 #endif
 
diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp
index f1181a4aa7..869a546f39 100644
--- a/src/unix/fontenum.cpp
+++ b/src/unix/fontenum.cpp
@@ -17,11 +17,13 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontenum.h"
 #endif
 
-#include "wx/defs.h"
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dynarray.h"
 #include "wx/string.h"
 #include "wx/regex.h"
diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp
index dd86095d0b..268300e5fc 100644
--- a/src/unix/fontutil.cpp
+++ b/src/unix/fontutil.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "fontutil.h"
 #endif
 
diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp
index 710841201a..2ea86f9a8d 100644
--- a/src/unix/joystick.cpp
+++ b/src/unix/joystick.cpp
@@ -9,10 +9,13 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "joystick.h"
 #endif
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 
 #if wxUSE_JOYSTICK
diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp
index a8c0329c91..7a8cbfc2f1 100644
--- a/src/unix/mimetype.cpp
+++ b/src/unix/mimetype.cpp
@@ -40,7 +40,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mimetype.h"
 #endif
 
diff --git a/src/unix/snglinst.cpp b/src/unix/snglinst.cpp
index 24ba3328da..df4971de41 100644
--- a/src/unix/snglinst.cpp
+++ b/src/unix/snglinst.cpp
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "snglinst.h"
 #endif
 
diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp
index e5081d684c..841786b04b 100644
--- a/src/unix/taskbarx11.cpp
+++ b/src/unix/taskbarx11.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "taskbarx11.h"
 #endif
 
diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp
index 597f87eb8d..ac55f84a1f 100644
--- a/src/unix/threadpsx.cpp
+++ b/src/unix/threadpsx.cpp
@@ -21,11 +21,12 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "thread.h"
 #endif
 
-#include "wx/defs.h"
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #if wxUSE_THREADS
 
diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp
index bbec3070ae..bfb252f998 100644
--- a/src/unix/utilsunx.cpp
+++ b/src/unix/utilsunx.cpp
@@ -15,6 +15,9 @@
 // headers
 // ----------------------------------------------------------------------------
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/defs.h"
 #include "wx/string.h"
 
diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp
index 32f4ef60e7..38868be697 100644
--- a/src/unix/utilsx11.cpp
+++ b/src/unix/utilsx11.cpp
@@ -11,6 +11,9 @@
 
 #if defined(__WXX11__) || defined(__WXGTK__) || defined(__WXMOTIF__)
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/unix/utilsx11.h"
 #include "wx/iconbndl.h"
 #include "wx/image.h"
diff --git a/src/unix/wave.cpp b/src/unix/wave.cpp
index 747514360d..36c9c09660 100644
--- a/src/unix/wave.cpp
+++ b/src/unix/wave.cpp
@@ -9,10 +9,13 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "wave.h"
 #endif
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/setup.h"
 
 #if wxUSE_WAVE
diff --git a/src/x11/app.cpp b/src/x11/app.cpp
index 57612cd474..e1aa3e759a 100644
--- a/src/x11/app.cpp
+++ b/src/x11/app.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "app.h"
 #endif
 
diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp
index deb6241645..12a782db43 100644
--- a/src/x11/bitmap.cpp
+++ b/src/x11/bitmap.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "bitmap.h"
 #endif
 
diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp
index 5fa6c149e8..a3caec4115 100644
--- a/src/x11/brush.cpp
+++ b/src/x11/brush.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "brush.h"
 #endif
 
diff --git a/src/x11/clipbrd.cpp b/src/x11/clipbrd.cpp
index bb143dcc1f..e9ba9c5a04 100644
--- a/src/x11/clipbrd.cpp
+++ b/src/x11/clipbrd.cpp
@@ -8,7 +8,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "clipbrd.h"
 #endif
 
diff --git a/src/x11/colour.cpp b/src/x11/colour.cpp
index 28bb7c7dda..d9ef085808 100644
--- a/src/x11/colour.cpp
+++ b/src/x11/colour.cpp
@@ -10,7 +10,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "colour.h"
 #endif
 
diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp
index 7722a56fb9..014064ea69 100644
--- a/src/x11/cursor.cpp
+++ b/src/x11/cursor.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp
index 548bbe151f..c095c13aa2 100644
--- a/src/x11/dataobj.cpp
+++ b/src/x11/dataobj.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dataobj.h"
 #endif
 
diff --git a/src/x11/dc.cpp b/src/x11/dc.cpp
index aeef76c8fd..cad69fdf09 100644
--- a/src/x11/dc.cpp
+++ b/src/x11/dc.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dc.h"
 #endif
 
diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp
index 162a8c7153..edc41476d1 100644
--- a/src/x11/dcclient.cpp
+++ b/src/x11/dcclient.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dcclient.h"
 #endif
 
diff --git a/src/x11/dcmemory.cpp b/src/x11/dcmemory.cpp
index aa2132140d..65affeed87 100644
--- a/src/x11/dcmemory.cpp
+++ b/src/x11/dcmemory.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcmemory.h"
 #endif
 
diff --git a/src/x11/dcscreen.cpp b/src/x11/dcscreen.cpp
index 58f24d50ca..a1999ffcec 100644
--- a/src/x11/dcscreen.cpp
+++ b/src/x11/dcscreen.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
diff --git a/src/x11/dnd.cpp b/src/x11/dnd.cpp
index f4a9cefec7..9ed4df67e6 100644
--- a/src/x11/dnd.cpp
+++ b/src/x11/dnd.cpp
@@ -7,7 +7,7 @@
 // Licence:   	wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dnd.h"
 #endif
 
diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp
index 701d4cd973..0ac0eafb21 100644
--- a/src/x11/evtloop.cpp
+++ b/src/x11/evtloop.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
diff --git a/src/x11/font.cpp b/src/x11/font.cpp
index 3e57b0e444..773246bbe6 100644
--- a/src/x11/font.cpp
+++ b/src/x11/font.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
diff --git a/src/x11/gdiobj.cpp b/src/x11/gdiobj.cpp
index 63613b5727..89a00f8370 100644
--- a/src/x11/gdiobj.cpp
+++ b/src/x11/gdiobj.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "gdiobj.h"
 #endif
 
diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp
index fabb565b27..9fc512eb43 100644
--- a/src/x11/glcanvas.cpp
+++ b/src/x11/glcanvas.cpp
@@ -10,7 +10,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "glcanvas.h"
 #endif
 
diff --git a/src/x11/icon.cpp b/src/x11/icon.cpp
index e563e7b548..0086004ff4 100644
--- a/src/x11/icon.cpp
+++ b/src/x11/icon.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "icon.h"
 #endif
 
diff --git a/src/x11/joystick.cpp b/src/x11/joystick.cpp
index 9b7a84dfbc..a21ce29b22 100644
--- a/src/x11/joystick.cpp
+++ b/src/x11/joystick.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "joystick.h"
 #endif
 
diff --git a/src/x11/minifram.cpp b/src/x11/minifram.cpp
index 1161e3de57..50524f2452 100644
--- a/src/x11/minifram.cpp
+++ b/src/x11/minifram.cpp
@@ -9,7 +9,7 @@
 // Licence:   	wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "minifram.h"
 #endif
 
diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp
index 67c40ced54..c95becb4b9 100644
--- a/src/x11/palette.cpp
+++ b/src/x11/palette.cpp
@@ -34,7 +34,7 @@ recommended; only the window manager should do this...  Also, it is
 not the functionality that wxPalette::Create() aims to provide.
  */
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "palette.h"
 #endif
 
diff --git a/src/x11/pen.cpp b/src/x11/pen.cpp
index 80a64d6edb..ecff52dd02 100644
--- a/src/x11/pen.cpp
+++ b/src/x11/pen.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "pen.h"
 #endif
 
diff --git a/src/x11/popupwin.cpp b/src/x11/popupwin.cpp
index 89991df729..35bbf8c99f 100644
--- a/src/x11/popupwin.cpp
+++ b/src/x11/popupwin.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "popupwin.h"
 #endif
 
diff --git a/src/x11/region.cpp b/src/x11/region.cpp
index b1575a3f0d..78be859708 100644
--- a/src/x11/region.cpp
+++ b/src/x11/region.cpp
@@ -8,7 +8,7 @@
 // Licence:   wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "region.h"
 #endif
 
diff --git a/src/x11/reparent.cpp b/src/x11/reparent.cpp
index e8ce0ba30f..7e76d2334d 100644
--- a/src/x11/reparent.cpp
+++ b/src/x11/reparent.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "reparent.h"
 #endif
 
diff --git a/src/x11/settings.cpp b/src/x11/settings.cpp
index ef5de6e208..188217ba89 100644
--- a/src/x11/settings.cpp
+++ b/src/x11/settings.cpp
@@ -13,7 +13,7 @@
 // per-user file, which can be edited using a Windows-control-panel clone.
 // Also they should be documented better. Some are very MS Windows-ish.
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settings.h"
 #endif
 
diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp
index 4fb30cedcc..84b9ae0290 100644
--- a/src/x11/textctrl.cpp
+++ b/src/x11/textctrl.cpp
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "textctrl.h"
 #endif
 
diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp
index cc51c21001..adb3b42178 100644
--- a/src/x11/toplevel.cpp
+++ b/src/x11/toplevel.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
diff --git a/src/x11/window.cpp b/src/x11/window.cpp
index fe52bbff49..4c8a3ce35b 100644
--- a/src/x11/window.cpp
+++ b/src/x11/window.cpp
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "window.h"
 #endif
 
diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp
index 2f95a43118..7fc49292a2 100644
--- a/src/xml/xml.cpp
+++ b/src/xml/xml.cpp
@@ -8,7 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xml.h"
 #endif
 
-- 
2.47.2