Skip to content

Commit

Permalink
Use int64_t for KLU_INDEXTYPE if SUNDIALS_INT64_T is true.
Browse files Browse the repository at this point in the history
`long int` is 32 bits wide on systems that use an LLP64 data model
(e.g., Windows). Use a type for which the C standard guarantees that it
is 64-bit instead (i.e., `int64_t`).

Signed-off-by: Markus Mützel <[email protected]>
  • Loading branch information
mmuetzel committed May 15, 2024
1 parent fe94036 commit 6e3d36d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sunlinsol/klu/sunlinsol_klu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* the SUNLINSOL package.
* -----------------------------------------------------------------*/

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sundials/sundials_math.h>
Expand Down Expand Up @@ -49,7 +50,7 @@
*/

#if defined(SUNDIALS_INT64_T)
#define KLU_INDEXTYPE long int
#define KLU_INDEXTYPE int64_t
#else
#define KLU_INDEXTYPE int
#endif
Expand Down

0 comments on commit 6e3d36d

Please sign in to comment.