FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_fstr_endian.c
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright (c) 2019 FrontISTR Commons
3 * This software is released under the MIT License, see LICENSE.txt
4 *****************************************************************************/
5
6#include <stdint.h>
7
8#include "hecmw_fstr_endian.h"
9
19 union {
20 uint32_t i;
21 char c[4];
22 } endian = {0x01020304};
23
24 return endian.c[0] == true;
25}
26
35const char* HECMW_endian_str(void) {
36 if (HECMW_is_big_endian() == true) {
37 return "BigEndian";
38 } else {
39 return "LittleEndian";
40 }
41}
const char * HECMW_endian_str(void)
function for investigating endian of running CPU
bool HECMW_is_big_endian(void)
function for investigating endian of running CPU