2015-06-24 19:00:01 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2004-01-10 01:09:51 +03:00
|
|
|
/*
|
2007-03-29 05:00:33 +04:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2015-06-24 19:00:01 +03:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-01-10 01:09:51 +03:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* This file includes the C99 stdint.h file if available, and otherwise
|
|
|
|
* defines fixed-width types according to the SIZEOF information
|
|
|
|
* gathered by configure.
|
|
|
|
*/
|
|
|
|
|
2007-03-29 05:00:33 +04:00
|
|
|
#ifndef OPAL_STDINT_H
|
|
|
|
#define OPAL_STDINT_H 1
|
2004-01-10 01:09:51 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Include what we can and define what is missing.
|
|
|
|
*/
|
2005-12-01 21:28:20 +03:00
|
|
|
#include <limits.h>
|
2015-06-24 19:00:01 +03:00
|
|
|
#include <stdint.h>
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2004-08-16 03:54:30 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-01-10 01:09:51 +03:00
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
2014-12-04 02:46:22 +03:00
|
|
|
/* 128-bit */
|
|
|
|
|
|
|
|
#ifdef HAVE_INT128_T
|
|
|
|
|
|
|
|
typedef int128_t opal_int128_t;
|
|
|
|
typedef uint128_t opal_uint128_t;
|
|
|
|
|
|
|
|
#define HAVE_OPAL_INT128_T 1
|
|
|
|
|
2014-12-05 06:14:31 +03:00
|
|
|
#elif defined(HAVE___INT128)
|
2014-12-04 02:46:22 +03:00
|
|
|
|
|
|
|
/* suppress warning about __int128 type */
|
2014-12-05 17:19:14 +03:00
|
|
|
#pragma GCC diagnostic push
|
2015-01-06 01:41:42 +03:00
|
|
|
/* Clang won't quietly accept "-pedantic", but GCC versions older than ~4.8
|
|
|
|
* won't quietly accept "-Wpedanic". The whole "#pragma GCC diagnostic ..."
|
|
|
|
* facility only was added to GCC as of version 4.6. */
|
|
|
|
#if defined(__clang__)
|
2014-12-04 02:46:22 +03:00
|
|
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
2015-01-06 01:41:42 +03:00
|
|
|
#else
|
|
|
|
#pragma GCC diagnostic ignored "-pedantic"
|
|
|
|
#endif
|
2014-12-04 02:46:22 +03:00
|
|
|
typedef __int128 opal_int128_t;
|
|
|
|
typedef unsigned __int128 opal_uint128_t;
|
2014-12-05 17:19:14 +03:00
|
|
|
#pragma GCC diagnostic pop
|
2014-12-04 02:46:22 +03:00
|
|
|
|
|
|
|
#define HAVE_OPAL_INT128_T 1
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define HAVE_OPAL_INT128_T 0
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-01-10 01:09:51 +03:00
|
|
|
/* Pointers */
|
|
|
|
|
|
|
|
#if SIZEOF_VOID_P == SIZEOF_INT
|
|
|
|
|
|
|
|
#ifndef HAVE_INTPTR_T
|
|
|
|
typedef signed int intptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_UINTPTR_T
|
|
|
|
typedef unsigned int uintptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#elif SIZEOF_VOID_P == SIZEOF_LONG
|
|
|
|
|
|
|
|
#ifndef HAVE_INTPTR_T
|
|
|
|
typedef signed long intptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_UINTPTR_T
|
|
|
|
typedef unsigned long uintptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#elif HAVE_LONG_LONG && SIZEOF_VOID_P == SIZEOF_LONG_LONG
|
|
|
|
|
|
|
|
#ifndef HAVE_INTPTR_T
|
|
|
|
typedef signed long long intptr_t;
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINTPTR_T
|
|
|
|
typedef unsigned long long uintptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#error Failed to define pointer-sized integer types
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-02-14 06:31:49 +03:00
|
|
|
/* inttypes.h printf specifiers */
|
|
|
|
# include <inttypes.h>
|
|
|
|
|
2008-02-27 22:38:14 +03:00
|
|
|
#ifndef PRIsize_t
|
|
|
|
# if defined(ACCEPT_C99)
|
|
|
|
# define PRIsize_t "zu"
|
|
|
|
# elif SIZEOF_SIZE_T == SIZEOF_LONG
|
|
|
|
# define PRIsize_t "lu"
|
|
|
|
# elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
|
|
|
|
# define PRIsize_t "llu"
|
2008-03-05 20:20:11 +03:00
|
|
|
# else
|
|
|
|
# define PRIsize_t "u"
|
2008-02-27 22:38:14 +03:00
|
|
|
# endif
|
2008-03-05 01:30:35 +03:00
|
|
|
#endif
|
2008-02-27 22:38:14 +03:00
|
|
|
|
2007-03-29 05:00:33 +04:00
|
|
|
#endif /* OPAL_STDINT_H */
|
2004-01-10 01:09:51 +03:00
|
|
|
|