~ubuntu-branches/ubuntu/raring/clucene-core/raring-proposed

« back to all changes in this revision

Viewing changes to src/shared/CLucene/debug/_condition.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-08-11 09:33:38 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120811093338-fgrx41ftqew3qt6a
Tags: 2.3.3.4-1
* New upstream release (Closes: #661703).
* Convert package to multiarch.
* Drop obsolete patches:
  - 01_add_missing_include_bug505667.diff
  - 02_posixness_fix_bug530308.diff
* Add patches:
  - Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
  - Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
  - Install-contribs-lib.patch
  - multiarch.patch
* Update debian/compat: bump to 8.
* Update debian/control:
  - update build dependencies (add cmake, libboost-dev and libz-dev).
  - bump Standards-Version to 3.9.3.
  - rename packages due to ABI bump: libclucene0ldbl -> libclucene-core1.
  - add libclucene-contribs1 package.
* Update debian/rules:
  - rewrite to use CMake.
  - add multiarch support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*------------------------------------------------------------------------------
 
2
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
 
3
*
 
4
* Distributable under the terms of either the Apache License (Version 2.0) or
 
5
* the GNU Lesser General Public License, as specified in the COPYING file.
 
6
------------------------------------------------------------------------------*/
 
7
#ifndef __CONDITION_H
 
8
#define __CONDITION_H
 
9
 
 
10
//todo: this is a hack
 
11
#undef CND_PRECONDITION
 
12
 
 
13
/*
 
14
To enable condition debugging uncomment _CND_DEBUG in CLConfig.h
 
15
*/
 
16
 
 
17
#ifdef _CL__CND_DEBUG   /* Don't include the debug code */
 
18
    /* _CL__CND_DEBUG defined, include debug code */
 
19
 
 
20
        #ifdef _CND_NODEBUGTEXT
 
21
                #define CND_PRECONDITION(cond,usermessage)                              CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,NULL)
 
22
                #define CND_CONDITION(cond,usermessage)                                 CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,NULL)
 
23
                #define CND_WARNING(cond,usermessage)                                   CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,NULL)
 
24
                #define CND_MESSAGE(cond,usermessage)                                   CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,NULL)
 
25
                #define CND_DEBUGMESSAGE(usermessage)                                   CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,NULL)
 
26
        #else
 
27
                #define CND_PRECONDITION(cond,usermessage)                              CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,usermessage)
 
28
                #define CND_CONDITION(cond,usermessage)                                 CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,usermessage)
 
29
                #define CND_WARNING(cond,usermessage)                                   CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,usermessage)
 
30
                #define CND_MESSAGE(cond,usermessage)                                   CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,usermessage)
 
31
                #define CND_DEBUGMESSAGE(usermessage)                                   CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,usermessage)
 
32
        #endif
 
33
 
 
34
        //if _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG is defined, then you must implement
 
35
        //this routine in the client application. The debug callback can then
 
36
        //be better customised to the host application.
 
37
        //Here is the default implementation:
 
38
        void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal );
 
39
 
 
40
        void CLUCENE_SHARED_EXPORT __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal );
 
41
        #define CND__EXIT(file,line,title,mes2)                                         {__cnd_FormatDebug(file,line,title,mes2,1);}
 
42
        #define CND__EXITCONDITION(cond,file,line,title,mes2)           {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,1);}}
 
43
        #define CND__CONDITION(cond,file,line,title,mes2)                       {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,0);}}
 
44
        #define CND__MESSAGE(file,line,title,mes2)                                      {__cnd_FormatDebug(file,line,title,mes2,0);}
 
45
#else
 
46
    #define CND_PRECONDITION(cond, usermessage)
 
47
    #define CND_CONDITION(cond, usermessage)
 
48
    #define CND_WARNING(cond,usermessage)
 
49
    #define CND_MESSAGE(cond,usermessage)
 
50
    #define CND_DEBUGMESSAGE(usermessage)
 
51
#endif
 
52
 
 
53
#ifndef CND_STR_DEFINES
 
54
    #define CND_STR_DEFINES
 
55
    #define CND_STR_PRECONDITION                                                                1
 
56
    #define CND_STR_CONDITION                                                                   2
 
57
    #define CND_STR_WARNING                                                                             3
 
58
    #define CND_STR_MESSAGE                                                                             4
 
59
    #define CND_STR_DEBUGMESSAGE                                                                5
 
60
    #define CND_STR_EXIT                                                                                6
 
61
#endif
 
62
 
 
63
//cnd-debug exit command
 
64
#ifndef debugFatalExit
 
65
 #define debugFatalExit(ret) exit(ret)
 
66
#endif
 
67
 
 
68
 
 
69
#endif