aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/libgfortran.h
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2017-11-22 19:19:13 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2017-11-22 19:19:13 +0000
commit43938465c326dffb8bb77079f65afccc6f4df80d (patch)
treed591cf873aa6b611276b396c56845bbd1e9af949 /libgfortran/libgfortran.h
parentffb2e0d06e5e3672826752b911f86e8402c9e1bb (diff)
PR 83097 Use __BYTE_ORDER__ predefined macro instead of runtime check
By using the __BYTE_ORDER__ predefined macro we don't need the determine_endianness function anymore. Regtested on x86_64-pc-linux-gnu. libgfortran/ChangeLog: 2017-11-22 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/83097 * io/inquire.c (inquire_via_unit): Use __BYTE_ORDER__ predefined macro. * io/open.c (st_open): Likewise. * io/transfer.c (data_transfer_init): Likewise. * io/write.c (btoa_big): Likewise. (otoa_big): Likewise. (ztoa_big): Likewise. * libgfortran.h (big_endian): Remove variable. (GFOR_POINTER_TO_L1): Use __BYTE_ORDER__ macro. * runtime/main.c (determine_endianness): Remove function. (init): Remove call to determine_endianness. * runtime/minimal.c: Remove setting big_endian variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255072 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/libgfortran.h')
-rw-r--r--libgfortran/libgfortran.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 52f4764a307..21ad5fc23fd 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -266,12 +266,8 @@ typedef GFC_UINTEGER_4 gfc_char4_t;
simply equal to the kind parameter itself. */
#define GFC_SIZE_OF_CHAR_KIND(kind) (kind)
-/* This will be 0 on little-endian machines and one on big-endian machines. */
-extern int big_endian;
-internal_proto(big_endian);
-
#define GFOR_POINTER_TO_L1(p, kind) \
- (big_endian * (kind - 1) + (GFC_LOGICAL_1 *)(p))
+ ((__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1: 0) * (kind - 1) + (GFC_LOGICAL_1 *)(p))
#define GFC_INTEGER_1_HUGE \
(GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1)