compile_assert.h revision a6451827d543eb00824bc95097e47d0aac51ae93
1a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin/*
2a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *
4a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  Use of this source code is governed by a BSD-style license
5a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  that can be found in the LICENSE file in the root of the source
6a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  tree. An additional intellectual property rights grant can be found
7a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  in the file PATENTS.  All contributing project authors may
8a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *  be found in the AUTHORS file in the root of the source tree.
9a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin */
10a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin
11a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
12a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
13a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin
14a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin/* Use this macro to verify at compile time that certain restrictions are met.
15a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin * The argument is the boolean expression to evaluate.
16a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin * Example:
17a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin *   COMPILE_ASSERT(sizeof(foo) < 128);
18a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin*/
19a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin#define COMPILE_ASSERT(expression) switch(0){case 0: case expression:;}
20a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin
21a6451827d543eb00824bc95097e47d0aac51ae93Alexander Gutkin#endif  // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
22