unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

modversion.h (2757B)

      1 /************************************************************************
      2  *   Unreal Internet Relay Chat Daemon, include/modversion.h
      3  *   (C) 2004-2005 Bram Matthys and The UnrealIRCd Team
      4  *
      5  *   This program is free software; you can redistribute it and/or modify
      6  *   it under the terms of the GNU General Public License as published by
      7  *   the Free Software Foundation; either version 1, or (at your option)
      8  *   any later version.
      9  *
     10  *   This program is distributed in the hope that it will be useful,
     11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  *   GNU General Public License for more details.
     14  *
     15  *   You should have received a copy of the GNU General Public License
     16  *   along with this program; if not, write to the Free Software
     17  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     18  *
     19  *   $Id$
     20  */
     21 
     22 #include "version.h"
     23 
     24 /* What all this is for? Well, it's simple...
     25  * Example: When someone compiles a module with ssl support, but the
     26  * core was not compiled with ssl support, then the module will read
     27  * things incorrect in the struct because the module sees an extra
     28  * field half-way the struct but in the core that field does not exist,
     29  * hence all data is shifted 4 bytes causing all kinds of odd crashes,
     30  * memory corruption, and weird problems.
     31  * This is an attempt to prevent this a bit, but there are a lot more
     32  * options that cause binary incompatability (eg: changing nicklen),
     33  * we just take the most common ones...
     34  *
     35  * NOTE: On win32 we allow ssl inconsistencies because we
     36  *       explicitly use "padding" in the structs: we add a useless
     37  *       placeholder so everything is still aligned correctly.
     38  *       In the process of doing so, we waste several bytes per-user,
     39  *       but this prevents (most) binary incompatability problems
     40  *       making it easier for module coders to ship dll's.
     41  */
     42  #ifndef _WIN32
     43   #define MYTOKEN_SSL "/SSL"
     44  #else
     45   #define MYTOKEN_SSL ""
     46  #endif
     47  #define MYTOKEN_NEWCHF "/NOCHF"
     48 
     49 #ifdef __GNUC__
     50  #if defined(__GNUC_PATCHLEVEL__)
     51   #define GCCVER ((__GNUC__ << 16) + (__GNUC_MINOR__ << 8) + __GNUC_PATCHLEVEL__)
     52  #else
     53   #define GCCVER ((__GNUC__ << 16) + (__GNUC_MINOR__ << 8))
     54  #endif
     55 #else
     56  #define GCCVER 0
     57 #endif
     58   
     59 
     60 #ifdef UNREALCORE
     61   char our_mod_version[] = BASE_VERSION "-" PATCH1 PATCH2 PATCH3 PATCH4 PATCH6 PATCH7 PATCH8 PATCH9 \
     62                                MYTOKEN_SSL MYTOKEN_NEWCHF;
     63   unsigned int our_compiler_version = GCCVER;
     64 #else
     65   DLLFUNC char Mod_Version[] = BASE_VERSION "-" PATCH1 PATCH2 PATCH3 PATCH4 PATCH6 PATCH7 PATCH8 PATCH9 \
     66                                MYTOKEN_SSL MYTOKEN_NEWCHF;
     67   DLLFUNC unsigned int compiler_version = GCCVER;
     68 #endif