mirror of
https://github.com/amd/blis.git
synced 2026-03-19 08:47:21 +00:00
Redefined bool_t typedef in terms of C99 bool.
Details:
- Changed the typedef that defines bool_t from:
typedef gint_t bool_t;
where gint_t is a signed integer that forms the basis of most other
integers in BLIS, to:
typedef bool bool_t;
- Changed BLIS's TRUE and FALSE macro definitions from being in terms of
integer literals:
#define TRUE 1
#define FALSE 0
to being in terms of C99 boolean constants:
#define TRUE true
#define FALSE false
which are provided by stdbool.h.
- This commit constitutes the second phase of a transition toward using
C99's bool instead of bool_t, which will address issue #420. The first
phase, which cleaned up various typecasts in preparation for using
bool as the basis for bool_t (instead of gint_t), was implemented by
commit a69a4d7.
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
// For C99 (or later), include stdint.h.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#else
|
||||
// When stdint.h is not available, manually typedef the types we will use.
|
||||
#ifdef _WIN32
|
||||
@@ -87,20 +88,19 @@ typedef unsigned long int guint_t;
|
||||
|
||||
// -- Boolean type --
|
||||
|
||||
typedef gint_t bool_t;
|
||||
|
||||
|
||||
// -- Boolean values --
|
||||
typedef bool bool_t;
|
||||
|
||||
// BLIS uses TRUE and FALSE macro constants as possible boolean values, but we
|
||||
// define these macros in terms of true and false, respectively, which are
|
||||
// defined by C99 in stdbool.h.
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#define TRUE true
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#define FALSE false
|
||||
#endif
|
||||
|
||||
|
||||
// -- Special-purpose integers --
|
||||
|
||||
// This cpp guard provides a temporary hack to allow libflame
|
||||
|
||||
Reference in New Issue
Block a user