File: ffcall-stdint.h

package info (click to toggle)
ffcall 2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,808 kB
  • sloc: asm: 43,409; ansic: 23,224; sh: 5,383; makefile: 1,517; cpp: 2
file content (40 lines) | stat: -rw-r--r-- 1,645 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright 2017 Bruno Haible <bruno@clisp.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/* Replacement for a subset of <stdint.h>.
   We cannot use gnulib's portable <stdint.h> replacement, because when
   cross-compiling the various avcall-$(CPU).c and vacall-$(CPU).c files,
   gnulib-generated files are not available. And the cross-compilers of
   GCC version < 4.5 don't provide <stdint.h>. */

/* Define integer types that are as large as a pointer, */

#if defined(__x86_64__) && (defined(_WIN32) || defined(__WIN32__)) && !defined(__CYGWIN__)
/* An LLP64 platform. */
typedef long long ff_intptr_t;
typedef unsigned long long ff_uintptr_t;
#else
/* An ILP32 or LP64 platform. */
typedef long ff_intptr_t;
typedef unsigned long ff_uintptr_t;
#endif
#define intptr_t ff_intptr_t
#define uintptr_t ff_uintptr_t

/* Verify at compile time that sizeof([u]intptr_t) == sizeof(void*). */
typedef int intptr_verify[2*(sizeof(intptr_t) == sizeof(void*))-1];
typedef int uintptr_verify[2*(sizeof(uintptr_t) == sizeof(void*))-1];