iPXE
mlx_bail.h
Go to the documentation of this file.
1#ifndef INCLUDE_PUBLIC_MLXBAIL_H_
2#define INCLUDE_PUBLIC_MLXBAIL_H_
3
4/*
5 * Copyright (C) 2015 Mellanox Technologies Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23FILE_LICENCE ( GPL2_OR_LATER );
24
25#include "mlx_types.h"
26
27#define MLX_BAIL_ERROR(id, status,message) MLX_CHECK_STATUS(id, status, bail, message)
28
29#define MLX_FATAL_CHECK_STATUS(status, label, message) \
30 do { \
31 if (status != MLX_SUCCESS) { \
32 MLX_DEBUG_FATAL_ERROR(message " (Status = %d)\n", status); \
33 goto label; \
34 } \
35 } while (0)
36
37#define MLX_CHECK_STATUS(id, status, label, message) \
38 do { \
39 if (status != MLX_SUCCESS) { \
40 MLX_DEBUG_ERROR(id, message " (Status = %d)\n", status);\
41 goto label; \
42 } \
43 } while (0)
44
45
46
47#endif /* INCLUDE_PUBLIC_MLXBAIL_H_ */
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896