-
+ FAB4D9725D153347B3E67DCBC53ED25F5F8CD8149D35B17F11CE06CD62A825368F95B95F65F394395CEBE34BAA02AFD4F0B331D3019BA6E8B0DB73A947A7878A
eucrypt/mpi/include/types.h
(0 . 0)(1 . 138)
1796 /* types.h - some common typedefs
1797 * Modified by No Such Labs. (C) 2015. See README.
1798 *
1799 * This file was originally part of Gnu Privacy Guard (GPG), ver. 1.4.10,
1800 * SHA256(gnupg-1.4.10.tar.gz):
1801 * 0bfd74660a2f6cedcf7d8256db4a63c996ffebbcdc2cf54397bfb72878c5a85a
1802 * (C) 1994-2005 Free Software Foundation, Inc.
1803 *
1804 * This program is free software: you can redistribute it and/or modify
1805 * it under the terms of the GNU General Public License as published by
1806 * the Free Software Foundation, either version 3 of the License, or
1807 * (at your option) any later version.
1808 *
1809 * This program is distributed in the hope that it will be useful,
1810 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1811 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1812 * GNU General Public License for more details.
1813 *
1814 * You should have received a copy of the GNU General Public License
1815 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1816 */
1817
1818 #ifndef G10_TYPES_H
1819 #define G10_TYPES_H
1820
1821 #ifdef HAVE_INTTYPES_H
1822 /* For uint64_t */
1823 #include <inttypes.h>
1824 #endif
1825
1826 /* The AC_CHECK_SIZEOF() in configure fails for some machines.
1827 * we provide some fallback values here */
1828 #if !SIZEOF_UNSIGNED_SHORT
1829 #undef SIZEOF_UNSIGNED_SHORT
1830 #define SIZEOF_UNSIGNED_SHORT 2
1831 #endif
1832 #if !SIZEOF_UNSIGNED_INT
1833 #undef SIZEOF_UNSIGNED_INT
1834 #define SIZEOF_UNSIGNED_INT 4
1835 #endif
1836 #if !SIZEOF_UNSIGNED_LONG
1837 #undef SIZEOF_UNSIGNED_LONG
1838 #define SIZEOF_UNSIGNED_LONG 4
1839 #endif
1840
1841
1842 #include <sys/types.h>
1843
1844
1845 #ifndef HAVE_BYTE_TYPEDEF
1846 #undef byte /* maybe there is a macro with this name */
1847 typedef unsigned char byte;
1848 #define HAVE_BYTE_TYPEDEF
1849 #endif
1850
1851 #ifndef HAVE_USHORT_TYPEDEF
1852 #undef ushort /* maybe there is a macro with this name */
1853 typedef unsigned short ushort;
1854 #define HAVE_USHORT_TYPEDEF
1855 #endif
1856
1857 #ifndef HAVE_ULONG_TYPEDEF
1858 #undef ulong /* maybe there is a macro with this name */
1859 typedef unsigned long ulong;
1860 #define HAVE_ULONG_TYPEDEF
1861 #endif
1862
1863 #ifndef HAVE_U16_TYPEDEF
1864 #undef u16 /* maybe there is a macro with this name */
1865 #if SIZEOF_UNSIGNED_INT == 2
1866 typedef unsigned int u16;
1867 #elif SIZEOF_UNSIGNED_SHORT == 2
1868 typedef unsigned short u16;
1869 #else
1870 #error no typedef for u16
1871 #endif
1872 #define HAVE_U16_TYPEDEF
1873 #endif
1874
1875 #ifndef HAVE_U32_TYPEDEF
1876 #undef u32 /* maybe there is a macro with this name */
1877 #if SIZEOF_UNSIGNED_INT == 4
1878 typedef unsigned int u32;
1879 #elif SIZEOF_UNSIGNED_LONG == 4
1880 typedef unsigned long u32;
1881 #else
1882 #error no typedef for u32
1883 #endif
1884 #define HAVE_U32_TYPEDEF
1885 #endif
1886
1887 /****************
1888 * Warning: Some systems segfault when this u64 typedef and
1889 * the dummy code in cipher/md.c is not available. Examples are
1890 * Solaris and IRIX.
1891 */
1892 #ifndef HAVE_U64_TYPEDEF
1893 #undef u64 /* maybe there is a macro with this name */
1894 #if SIZEOF_UINT64_T == 8
1895 typedef uint64_t u64;
1896 #define U64_C(c) (UINT64_C(c))
1897 #define HAVE_U64_TYPEDEF
1898 #elif SIZEOF_UNSIGNED_INT == 8
1899 typedef unsigned int u64;
1900 #define U64_C(c) (c ## U)
1901 #define HAVE_U64_TYPEDEF
1902 #elif SIZEOF_UNSIGNED_LONG == 8
1903 typedef unsigned long u64;
1904 #define U64_C(c) (c ## UL)
1905 #define HAVE_U64_TYPEDEF
1906 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
1907 typedef unsigned long long u64;
1908 #define U64_C(c) (c ## ULL)
1909 #define HAVE_U64_TYPEDEF
1910 #endif
1911 #endif
1912
1913 typedef union {
1914 int a;
1915 short b;
1916 char c[1];
1917 long d;
1918 #ifdef HAVE_U64_TYPEDEF
1919 u64 e;
1920 #endif
1921 float f;
1922 double g;
1923 } PROPERLY_ALIGNED_TYPE;
1924
1925 struct string_list {
1926 struct string_list *next;
1927 unsigned int flags;
1928 char d[1];
1929 };
1930 typedef struct string_list *STRLIST;
1931 typedef struct string_list *strlist_t;
1932
1933 #endif /*G10_TYPES_H*/