win32 KUriFilterData problem with ERROR define

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed Aug 29 14:45:49 CEST 2007


> Von: Ralf Habacker <ralf.habacker at freenet.de>
> Hi,
> 
> in kio's KUriFilterData class 
> (http://lxr.kde.org/source/KDE/kdelibs/kio/kio/kurifilter.h#098)
> 
> there are the following enums defined
> 
> m UriTypes { NET_PROTOCOL=0, LOCAL_FILE, LOCAL_DIR, EXECUTABLE, HELP, 
> SHELL, BLOCKED, ERROR, UNKNOWN };
> 
> Because they are all uppercase at least the ERROR value collidates with 
> a win 32 preprozessor macro definition.
> 
> I recognized this when compiling kdebase with msvc
> 
> In
> 
> KonqMisc::konqFilteredURL
> 
> the line
> 193: if( data.uriType() == KUriFilterData::ERROR && 
> !data.errorMsg().isEmpty() )
> 
> is converted to     
> 
> 193: if( data.uriType() == KUriFilterData::0 && !data.errorMsg().isEmpty()
> )
> 
> which results in a error.
> 
> I can correct this problem in konqmisc.cpp  by undefining ERROR after 
> all includes as shown below
> 
> #ifdef Q_WS_WIN
> // windows defines ERROR
> #undef ERROR
> #endif
> 
> I remember that there were other similar cases and that they were fixed 
> by using non-all-uppercase enum values.
> 
> How to proceed ?
> 
Write to k-c-d and ask if we still can change it. If yes -> do it next monday. Otherwise include fixwin.h (it's from kdelibs/kdecore) - it should do nearly the same like you did.

Christian
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger



More information about the Kde-windows mailing list