Mercurial > ecos-v2_0-branch
annotate packages/language/c/libc/current/include/assert.h @ 34:29bc183297e1 ecos-sw-1999-09-02
Merge from eCos master repository on 1999-09-02-16:26:10-BST
| author | jlarmour |
|---|---|
| date | Thu, 02 Sep 1999 16:11:22 +0000 |
| parents | 443894e2e912 |
| children | c38311975d4f |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_LIBC_ASSERT_H |
| 2 #define CYGONCE_LIBC_ASSERT_H | |
| 3 //=========================================================================== | |
| 4 // | |
| 5 // assert.h | |
| 6 // | |
| 7 // ANSI standard assertion support as per ANSI chapter 7.2 | |
| 8 // | |
| 9 //=========================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
| 11 // | |
| 12 // ------------------------------------------- | |
| 13 // The contents of this file are subject to the Cygnus eCos Public License | |
| 14 // Version 1.0 (the "License"); you may not use this file except in | |
| 15 // compliance with the License. You may obtain a copy of the License at | |
| 16 // http://sourceware.cygnus.com/ecos | |
| 17 // | |
| 18 // Software distributed under the License is distributed on an "AS IS" | |
| 19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 20 // License for the specific language governing rights and limitations under | |
| 21 // the License. | |
| 22 // | |
| 23 // The Original Code is eCos - Embedded Cygnus Operating System, released | |
| 24 // September 30, 1998. | |
| 25 // | |
| 26 // The Initial Developer of the Original Code is Cygnus. Portions created | |
| 2 | 27 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 0 | 28 // ------------------------------------------- |
| 29 // | |
| 30 //####COPYRIGHTEND#### | |
| 31 //=========================================================================== | |
| 32 //#####DESCRIPTIONBEGIN#### | |
| 33 // | |
| 2 | 34 // Author(s): jlarmour |
| 35 // Contributors: jlarmour | |
| 0 | 36 // Date: 1998-02-13 |
| 37 // Purpose: | |
| 38 // Description: ANSI standard assertion support as per ANSI chapter 7.2 | |
| 39 // Usage: #include <assert.h> | |
| 40 // | |
| 41 //####DESCRIPTIONEND#### | |
| 42 // | |
| 43 //=========================================================================== | |
| 44 | |
| 45 // CONFIGURATION | |
| 46 | |
| 47 #include <pkgconf/libc.h> // Configuration header | |
| 48 | |
| 49 // Include the C library? | |
| 50 #ifdef CYGPKG_LIBC | |
| 51 | |
| 52 // INCLUDES | |
| 53 | |
| 54 #include <cyg/infra/cyg_type.h> // Common type definitions and support | |
| 55 #include <cyg/infra/cyg_ass.h> // Common assertion support | |
| 56 | |
| 57 // MACROS | |
| 58 | |
|
34
29bc183297e1
Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents:
2
diff
changeset
|
59 // The user should define NDEBUG to turn off these user assertions. Also the |
|
29bc183297e1
Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents:
2
diff
changeset
|
60 // common infrastructure assertions should be turned off too. |
| 0 | 61 |
|
34
29bc183297e1
Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents:
2
diff
changeset
|
62 #ifdef NDEBUG |
| 0 | 63 |
| 64 # define assert( _bool_ ) ((void)0) | |
| 65 | |
|
34
29bc183297e1
Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents:
2
diff
changeset
|
66 #else // if NDEBUG is NOT defined |
| 0 | 67 |
| 68 # define assert( _bool_ ) \ | |
| 69 CYG_MACRO_START \ | |
| 70 CYG_ASSERT( _bool_, "User assertion failed: \"" # _bool_ "\"" ); \ | |
| 71 CYG_MACRO_END | |
| 72 | |
|
34
29bc183297e1
Merge from eCos master repository on 1999-09-02-16:26:10-BST
jlarmour
parents:
2
diff
changeset
|
73 #endif // if NDEBUG is NOT defined |
| 0 | 74 |
| 75 | |
| 76 | |
| 77 #endif // ifdef CYGPKG_LIBC | |
| 78 | |
| 79 #endif // CYGONCE_LIBC_ASSERT_H multiple inclusion protection | |
| 80 | |
| 81 // EOF assert.h |
