File indexing completed on 2024-05-12 16:39:56

0001 /* This file is part of the KDE project
0002    Copyright (C) 2007 Jarosław Staniek <staniek@kde.org>
0003 
0004    This program is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This program is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this program; see the file COPYING.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef _KEXIUTILS_GLOBAL_H_
0021 #define _KEXIUTILS_GLOBAL_H_
0022 
0023 #ifndef WARNING
0024 #ifdef _MSC_VER
0025 /* WARNING preprocessor directive
0026  Reserved: preprocessor needs two indirections to replace __LINE__ with actual
0027  string
0028 */
0029 #define _MSG0(msg)     #msg
0030 /* Preprocessor needs two indirections to replace __LINE__ or __FILE__
0031  with actual string. */
0032 #define _MSG1(msg)    _MSG0(msg)
0033 
0034 /*! Creates message prolog with the name of the source file and the line
0035    number where a preprocessor message has been inserted.
0036 
0037   Example:
0038      #pragma KMESSAGE(Your message)
0039   Output:
0040      C:\MyCode.cpp(111) : Your message
0041 */
0042 # define _MSGLINENO __FILE__ "(" _MSG1(__LINE__) ") : warning: "
0043 # define WARNING(msg) message(_MSGLINENO #msg)
0044 #endif /*_MSC_VER*/
0045 #endif /*WARNING*/
0046 
0047 #endif