Skip to content

Commit

Permalink
libdecnumber: Don't fool around with guards to avoid #include
Browse files Browse the repository at this point in the history
Some libdecnumber headers avoid including decNumber.h or decContext.h
again by checking their header guards.  Don't.  Including them
multiple times is safe, and the compiler can do it efficiently.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
Markus Armbruster committed Jul 12, 2016
1 parent 121d071 commit 6031a51
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions include/libdecnumber/decNumber.h
Expand Up @@ -38,9 +38,7 @@
#define DECFULLNAME "Decimal Number Module" /* Verbose name */
#define DECAUTHOR "Mike Cowlishaw" /* Who to blame */

#if !defined(DECCONTEXT)
#include "libdecnumber/decContext.h"
#endif
#include "libdecnumber/decContext.h"

/* Bit settings for decNumber.bits */
#define DECNEG 0x80 /* Sign; 1=negative, 0=positive or zero */
Expand Down
4 changes: 1 addition & 3 deletions include/libdecnumber/dpd/decimal128.h
Expand Up @@ -59,9 +59,7 @@
#ifndef DECNUMDIGITS
#define DECNUMDIGITS DECIMAL128_Pmax /* size if not already defined*/
#endif
#ifndef DECNUMBER
#include "libdecnumber/decNumber.h"
#endif
#include "libdecnumber/decNumber.h"

/* Decimal 128-bit type, accessible by bytes */
typedef struct {
Expand Down
4 changes: 1 addition & 3 deletions include/libdecnumber/dpd/decimal32.h
Expand Up @@ -59,9 +59,7 @@
#ifndef DECNUMDIGITS
#define DECNUMDIGITS DECIMAL32_Pmax /* size if not already defined*/
#endif
#ifndef DECNUMBER
#include "libdecnumber/decNumber.h"
#endif
#include "libdecnumber/decNumber.h"

/* Decimal 32-bit type, accessible by bytes */
typedef struct {
Expand Down
4 changes: 1 addition & 3 deletions include/libdecnumber/dpd/decimal64.h
Expand Up @@ -61,9 +61,7 @@
#ifndef DECNUMDIGITS
#define DECNUMDIGITS DECIMAL64_Pmax /* size if not already defined*/
#endif
#ifndef DECNUMBER
#include "libdecnumber/decNumber.h"
#endif
#include "libdecnumber/decNumber.h"

/* Decimal 64-bit type, accessible by bytes */
typedef struct {
Expand Down

0 comments on commit 6031a51

Please sign in to comment.