-
+ FAB4D9725D153347B3E67DCBC53ED25F5F8CD8149D35B17F11CE06CD62A825368F95B95F65F394395CEBE34BAA02AFD4F0B331D3019BA6E8B0DB73A947A7878A
smg_comms/mpi/include/types.h
(0 . 0)(1 . 138)
2531 /* types.h - some common typedefs
2532 * Modified by No Such Labs. (C) 2015. See README.
2533 *
2534 * This file was originally part of Gnu Privacy Guard (GPG), ver. 1.4.10,
2535 * SHA256(gnupg-1.4.10.tar.gz):
2536 * 0bfd74660a2f6cedcf7d8256db4a63c996ffebbcdc2cf54397bfb72878c5a85a
2537 * (C) 1994-2005 Free Software Foundation, Inc.
2538 *
2539 * This program is free software: you can redistribute it and/or modify
2540 * it under the terms of the GNU General Public License as published by
2541 * the Free Software Foundation, either version 3 of the License, or
2542 * (at your option) any later version.
2543 *
2544 * This program is distributed in the hope that it will be useful,
2545 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2546 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2547 * GNU General Public License for more details.
2548 *
2549 * You should have received a copy of the GNU General Public License
2550 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2551 */
2552
2553 #ifndef G10_TYPES_H
2554 #define G10_TYPES_H
2555
2556 #ifdef HAVE_INTTYPES_H
2557 /* For uint64_t */
2558 #include <inttypes.h>
2559 #endif
2560
2561 /* The AC_CHECK_SIZEOF() in configure fails for some machines.
2562 * we provide some fallback values here */
2563 #if !SIZEOF_UNSIGNED_SHORT
2564 #undef SIZEOF_UNSIGNED_SHORT
2565 #define SIZEOF_UNSIGNED_SHORT 2
2566 #endif
2567 #if !SIZEOF_UNSIGNED_INT
2568 #undef SIZEOF_UNSIGNED_INT
2569 #define SIZEOF_UNSIGNED_INT 4
2570 #endif
2571 #if !SIZEOF_UNSIGNED_LONG
2572 #undef SIZEOF_UNSIGNED_LONG
2573 #define SIZEOF_UNSIGNED_LONG 4
2574 #endif
2575
2576
2577 #include <sys/types.h>
2578
2579
2580 #ifndef HAVE_BYTE_TYPEDEF
2581 #undef byte /* maybe there is a macro with this name */
2582 typedef unsigned char byte;
2583 #define HAVE_BYTE_TYPEDEF
2584 #endif
2585
2586 #ifndef HAVE_USHORT_TYPEDEF
2587 #undef ushort /* maybe there is a macro with this name */
2588 typedef unsigned short ushort;
2589 #define HAVE_USHORT_TYPEDEF
2590 #endif
2591
2592 #ifndef HAVE_ULONG_TYPEDEF
2593 #undef ulong /* maybe there is a macro with this name */
2594 typedef unsigned long ulong;
2595 #define HAVE_ULONG_TYPEDEF
2596 #endif
2597
2598 #ifndef HAVE_U16_TYPEDEF
2599 #undef u16 /* maybe there is a macro with this name */
2600 #if SIZEOF_UNSIGNED_INT == 2
2601 typedef unsigned int u16;
2602 #elif SIZEOF_UNSIGNED_SHORT == 2
2603 typedef unsigned short u16;
2604 #else
2605 #error no typedef for u16
2606 #endif
2607 #define HAVE_U16_TYPEDEF
2608 #endif
2609
2610 #ifndef HAVE_U32_TYPEDEF
2611 #undef u32 /* maybe there is a macro with this name */
2612 #if SIZEOF_UNSIGNED_INT == 4
2613 typedef unsigned int u32;
2614 #elif SIZEOF_UNSIGNED_LONG == 4
2615 typedef unsigned long u32;
2616 #else
2617 #error no typedef for u32
2618 #endif
2619 #define HAVE_U32_TYPEDEF
2620 #endif
2621
2622 /****************
2623 * Warning: Some systems segfault when this u64 typedef and
2624 * the dummy code in cipher/md.c is not available. Examples are
2625 * Solaris and IRIX.
2626 */
2627 #ifndef HAVE_U64_TYPEDEF
2628 #undef u64 /* maybe there is a macro with this name */
2629 #if SIZEOF_UINT64_T == 8
2630 typedef uint64_t u64;
2631 #define U64_C(c) (UINT64_C(c))
2632 #define HAVE_U64_TYPEDEF
2633 #elif SIZEOF_UNSIGNED_INT == 8
2634 typedef unsigned int u64;
2635 #define U64_C(c) (c ## U)
2636 #define HAVE_U64_TYPEDEF
2637 #elif SIZEOF_UNSIGNED_LONG == 8
2638 typedef unsigned long u64;
2639 #define U64_C(c) (c ## UL)
2640 #define HAVE_U64_TYPEDEF
2641 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
2642 typedef unsigned long long u64;
2643 #define U64_C(c) (c ## ULL)
2644 #define HAVE_U64_TYPEDEF
2645 #endif
2646 #endif
2647
2648 typedef union {
2649 int a;
2650 short b;
2651 char c[1];
2652 long d;
2653 #ifdef HAVE_U64_TYPEDEF
2654 u64 e;
2655 #endif
2656 float f;
2657 double g;
2658 } PROPERLY_ALIGNED_TYPE;
2659
2660 struct string_list {
2661 struct string_list *next;
2662 unsigned int flags;
2663 char d[1];
2664 };
2665 typedef struct string_list *STRLIST;
2666 typedef struct string_list *strlist_t;
2667
2668 #endif /*G10_TYPES_H*/