Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: include/assert.h

Issue 1496163002: [assert] Exclude static_assert macro when using C++ (Closed) Base URL: https://github.com/travisg/lk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 Travis Geiselbrecht 2 * Copyright (c) 2008 Travis Geiselbrecht
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining 4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files 5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction, 6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge, 7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software, 8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so, 9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions: 10 * subject to the following conditions:
(...skipping 20 matching lines...) Expand all
31 31
32 #if LK_DEBUGLEVEL > 1 32 #if LK_DEBUGLEVEL > 1
33 #define DEBUG_ASSERT(x) \ 33 #define DEBUG_ASSERT(x) \
34 do { if (unlikely(!(x))) { panic("DEBUG ASSERT FAILED at (%s:%d): %s\n", __F ILE__, __LINE__, #x); } } while (0) 34 do { if (unlikely(!(x))) { panic("DEBUG ASSERT FAILED at (%s:%d): %s\n", __F ILE__, __LINE__, #x); } } while (0)
35 #else 35 #else
36 #define DEBUG_ASSERT(x) \ 36 #define DEBUG_ASSERT(x) \
37 do { } while(0) 37 do { } while(0)
38 #endif 38 #endif
39 39
40 #define assert(e) DEBUG_ASSERT(e) 40 #define assert(e) DEBUG_ASSERT(e)
41
42 #ifndef __cplusplus
41 #define static_assert(e) STATIC_ASSERT(e) 43 #define static_assert(e) STATIC_ASSERT(e)
44 #endif
42 45
43 #endif 46 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698