00001 /* AbiSource Program Utilities 00002 * Copyright (C) 2004 Tomas Frydrych <tomasfrydrych@yahoo.co.uk> 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 00021 00022 /* 00023 This file must allow itself to be included multiple times !!! 00024 00025 This is a bit cumbersome, but since macros cannot expand to 00026 preprocessing directives, we cannot handle it by macro 00027 00028 To generate a compiler warning via #pragma you do 00029 00030 #define UT_WARNING "my message" 00031 #include "ut_warning.h" 00032 00033 this will generate message "warning: my message\n" 00034 00035 I could not find a way to get __FILE__ and __LINE__ into the 00036 output, as these will always expand to the location of #pragma in 00037 this file 00038 */ 00039 00040 00041 #ifdef UT_WARNING 00042 00043 #define __UT_WARNING "warning: " UT_WARNING "\n" 00044 00045 #if defined(_WIN32) 00046 #pragma message (__UT_WARNING) 00047 00048 /* 00049 Add platform-specfic implementations here 00050 */ 00051 #else 00052 #pragma warning __UT_WARNING 00053 #endif 00054 00055 /* now clean up */ 00056 #undef UT_WARNING 00057 #undef __UT_WARNING 00058 #endif