Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

global.h

Go to the documentation of this file.
00001 /*
00002 PeRdr - PE file disassembler
00003 Copyright (C) 1999-2002 Frediano Ziglio
00004 -----
00005 
00006 This program is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 -----
00020 
00021 INFORMATION
00022   www: https://freddy77.tripod.com/perdr/
00023   e-mail: freddy77@angelfire.com
00024 */
00025 #ifndef FILE_GLOBAL_H
00026 #define FILE_GLOBAL_H
00027 
00028 #include <cstdio>
00029 #include <cstdlib>
00030 #include "utils/bitcompat.h"
00031 
00032 #ifdef HAVE_CONFIG_H
00033 #include "../config.h"
00034 #endif
00035 
00036 #if BYTEORDER != 1234
00037 #error Sorry, this program work only on little-endian machines
00038 #endif
00039 
00040 #ifdef _MSC_VER
00041 // disabilita warning nome tipo troppo lungo per VC++
00042 #pragma warning( disable : 4786 )
00043 // disabilita warning unknown pragma per VC++
00044 #pragma warning( disable : 4068 )
00045 #endif
00046 
00047 #undef HAVE_HDRSTOP
00048 #if defined(_MSC_VER) || defined(__BORLANDC__)
00049 #define HAVE_HDRSTOP
00050 #endif
00051 
00052 typedef uint32_t vma_t;
00053 #define VMA_MIN 0
00054 #define VMA_MAX 0xfffffffflu
00055 typedef unsigned char uchar;
00056 
00057 #ifdef __GNUC__
00058 #define stricmp strcasecmp
00059 #endif
00060 
00061 // !!! other file
00062 #define FOR_EACH_BEGIN(type,container,iter) \
00063 { type::iterator __end = container.end(); \
00064 for(type::iterator iter = container.begin(); iter != __end; ++iter) {
00065 #define FOR_EACH_END(type,container,iter) } }
00066 
00067 #define FOR_EACH_CONST_BEGIN(type,container,iter) \
00068 { type::const_iterator __end = container.end(); \
00069 for(type::const_iterator iter = container.begin(); iter != __end; ++iter) {
00070 #define FOR_EACH_CONST_END(type,container,iter) } }
00071 
00072 #define ALLOF(container) container.begin(),container.end()
00073 
00074 // !!! for VC++
00075 #undef __min
00076 
00077 template <class T>
00078 inline const T& f77_min(const T& a,const T& b)
00079 {
00080   return (a<b)?a:b;
00081 }
00082 
00083 #include "debug.h"
00084 
00085 #endif  //FILE_GLOBAL_H

Generated on Mon Jan 13 22:20:34 2003 for perdr by doxygen1.2.15