Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace H5detect's build-time detection of C99 integer properties with a #1400

Merged
merged 17 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 16 additions & 27 deletions src/H5T.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,35 +473,21 @@ hid_t H5T_NATIVE_INT_FAST64_g = FAIL;
hid_t H5T_NATIVE_UINT_FAST64_g = FAIL;

/*
* Alignment constraints for native types. These are initialized at run time
* in H5Tinit.c. These alignments are mainly for offsets in HDF5 compound
* datatype or C structures, which are different from the alignments for memory
* address below this group of variables.
* Alignment constraints for HDF5 types. Accessing objects of these
* types with improper alignment invokes C undefined behavior, so the
* library lays out objects with correct alignment, always.
*
* A value of N indicates that the data must be aligned on an address
* ADDR such that 0 == ADDR mod N. When N=1 no alignment is required;
* N=0 implies that alignment constraints were not calculated. These
* values are used for structure alignment.
*/
size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0;

size_t H5T_POINTER_COMP_ALIGN_g = 0;
size_t H5T_HVL_COMP_ALIGN_g = 0;
size_t H5T_HOBJREF_COMP_ALIGN_g = 0;
size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0;
size_t H5T_REF_COMP_ALIGN_g = 0;
size_t H5T_POINTER_ALIGN_g = 0;
size_t H5T_HVL_ALIGN_g = 0;
size_t H5T_HOBJREF_ALIGN_g = 0;
size_t H5T_HDSETREGREF_ALIGN_g = 0;
size_t H5T_REF_ALIGN_g = 0;

/*
* Alignment constraints for native types. These are initialized at run time
* in H5Tinit.c
*/
size_t H5T_NATIVE_SCHAR_ALIGN_g = 0;
size_t H5T_NATIVE_UCHAR_ALIGN_g = 0;
size_t H5T_NATIVE_SHORT_ALIGN_g = 0;
Expand Down Expand Up @@ -777,6 +763,9 @@ H5T_init(void)
if (H5T__init_native() < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface")

if (H5T__init_native_int() < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize integers")

/* Get the atomic datatype structures needed by the initialization code below */
if (NULL == (native_schar = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
Expand Down
Loading