Source: classlib/include/_defs.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
    _defs.h  -  definizioni di sistema
                             -------------------
    begin                : ven dic  7 17:40:01 CET 2001
    copyright            : (C) 2001 by Nicola De Nisco
    email                : nicola@winada.it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#if !defined(___DEFS_H)
#define ___DEFS_H

#if defined(__cplusplus)
#   define _PTRDEF(name) typedef name  * P##name;
#   define _REFDEF(name) typedef name  & R##name;
#   define _REFPTRDEF(name) typedef name  *  & RP##name;
#   define _PTRCONSTDEF(name) typedef const name  * PC##name;
#   define _REFCONSTDEF(name) typedef const name  & RC##name;

#   define _CLASSDEF(name) class name; \
           _PTRDEF(name) \
           _REFDEF(name) \
           _REFPTRDEF(name) \
           _PTRCONSTDEF(name) \
           _REFCONSTDEF(name)

#define _CLASSTYPE

#define DECL_STRC(structname,idname)	\
	typedef struct structname idname;	\
	typedef struct structname* LP##idname; \
	typedef const struct structname* LPC##idname;
	
#define TRY	try {
#define END_TRY } catch(...) { }
#define T_TRY	try {
#define T_END_TRY } catch(...) { }
#define T_END_CATCH_ALL } catch(...) { }
#define T_END_CATCH } catch(...) { }

// versione semplificata
#define T__TRY try {
#define T__END_TRY } catch(...) {}
	
/*------------------------------------------------------------------------*/
/*                                                                        */
/*  Since inline functions that use throw specifiers                      */
/*  currently end up rather large, we don't use throw                     */
/*  specifiers on them unless you #define USE_THROW_SPECIFIERS.           */
/*                                                                        */
/*------------------------------------------------------------------------*/

#if defined( USE_THROW_SPECIFIERS )
#define THROW_NONE                  throw()
#define THROW_XALLOC                throw( xalloc )
#define THROW_OUTOFRANGE            throw( string::outofrange )
#define THROW_XALLOC_LENGTHERROR    throw( xalloc, string::lengtherror )
#define THROW_XALLOC_OUTOFRANGE     throw( xalloc, string::outofrange )
#define THROW_XALLOC_RANGE_LENGTH   \
        throw( xalloc, string::lengtherror, string::outofrange )
#else
#define THROW_NONE
#define THROW_XALLOC
#define THROW_OUTOFRANGE
#define THROW_XALLOC_LENGTHERROR
#define THROW_XALLOC_OUTOFRANGE
#define THROW_XALLOC_RANGE_LENGTH
#endif

#if !defined( _USE_THROW_SPECIFIERS )
#define USE_THROW_NONE
#define USE_THROW_XALLOC
#define USE_THROW_OUTOFRANGE
#define USE_THROW_XALLOC_LENGTHERROR
#define USE_THROW_XALLOC_OUTOFRANGE
#define USE_THROW_XALLOC_RANGE_LENGTH
#else
#define USE_THROW_NONE                  throw()
#define USE_THROW_XALLOC                throw( xalloc )
#define USE_THROW_OUTOFRANGE            throw( string::outofrange )
#define USE_THROW_XALLOC_LENGTHERROR    throw( xalloc, string::lengtherror )
#define USE_THROW_XALLOC_OUTOFRANGE     throw( xalloc, string::outofrange )
#define USE_THROW_XALLOC_RANGE_LENGTH   \
        throw( xalloc, string::lengtherror, string::outofrange )
#endif



#endif // __cplusplus


// comodo puntatori
#define SIZEPTR							(sizeof(LPVOID))
#define callocptr(num)			(calloc((num), SIZEPTR))
#define reallocptr(ptr,num)	(realloc(ptr, (num)*SIZEPTR))

#endif  /* ___DEFS_H */


Generated by: nicola on gulliver.wadahome.it on Sun May 25 13:54:34 2003, using kdoc 2.0a53.