Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
FaissAssert.h
1
2 /**
3 * Copyright (c) 2015-present, Facebook, Inc.
4 * All rights reserved.
5 *
6 * This source code is licensed under the CC-by-NC license found in the
7 * LICENSE file in the root directory of this source tree.
8 */
9
10 // Copyright 2004-present Facebook. All Rights Reserved.
11
12 #ifndef FAISS_ASSERT_INCLUDED
13 #define FAISS_ASSERT_INCLUDED
14
15 #include <cstdlib>
16 #include <cstdio>
17
18 /// Asserts that risk to be triggered by user input
19 #define FAISS_ASSERT(X) ({if (! (X)) { \
20 fprintf (stderr, "Faiss assertion %s failed in %s at %s:%d", \
21 #X, __PRETTY_FUNCTION__, __FILE__, __LINE__); \
22 abort(); }})
23
24
25
26 #endif