[patch] WARNING macro for msvc compilers

Jarosław Staniek js at iidea.pl
Wed Dec 5 00:24:41 CET 2007


Hello,
For review:
As msvc provides no #warning support, there can be something like #pragma used 
with special parameters. In Kexi development I've prepared and tested WARNING 
macro and now propose it for incusion into a toplevel win32 include.

1. Typical usage of #warning in a portable piece of code is:

#ifdef __GNUC__
# warning TODO implement this
#endif

2. However if someone develops with msvc and wants the warning(s) to appear in 
msvc buildsystem:

#ifdef __GNUC__
# warning TODO implement this
#else
# pragma WARNING( TODO implement this )
#endif

The WARNING macro displays function name as well.

Notes:
To use the code we could typically include <kde_file.h>.

I've even got a script which converts existing non-msvc code to 2nd form, 
what's useful for

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: winposix_export.patch
Url: http://mail.kde.org/pipermail/kde-windows/attachments/20071205/cfa799d0/attachment.ksh 


More information about the Kde-windows mailing list