OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [port/] [port.h] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1350 nogj
#ifndef __STRNDUP__
2
#define __STRNDUP__
3
 
4
#include <stdlib.h>
5
 
6
#if !defined(HAVE_STRNDUP)
7
char * strndup (const char *s, size_t n);
8
#endif
9
 
10
#endif
11
 
12
#ifndef HAS_ISBLANK
13
int isblank(int c);
14
#endif
15
 
16
#ifndef PRIx32
17
# if SIZEOF_INT == 4
18
#  define PRIx32 "x"
19
# elif SIZEOF_LONG == 4
20
#  define PRIx32 "lx"
21
# endif
22
#endif
23
 
24
#ifndef PRIx16
25
# if SIZEOF_SHORT == 2
26
#  define PRIx16 "hx"
27
# else
28
#  define PRIx16 "x"
29
# endif
30
#endif
31
 
32
#ifndef PRIx8
33
# if SIZEOF_CHAR == 1
34
#  define PRIx8 "hhx"
35
# else
36
#  define PRIx8 "x"
37
# endif
38
#endif
39
 
40
#ifndef PRIi32
41
# if SIZEOF_INT == 4
42
#  define PRIi32 "i"
43
# elif SIZEOF_LONG == 4
44
#  define PRIi32 "li"
45
# endif
46
#endif
47
 
48
#ifndef PRId32
49
# if SIZEOF_INT == 4
50
#  define PRId32 "d"
51
# elif SIZEOF_LONG == 4
52
#  define PRId32 "ld"
53
# endif
54
#endif
55
 
56
#ifndef UINT32_C
57
# if SIZEOF_INT == 4
58
#  define UINT32_C(c) c
59
# elif SIZEOF_LONG == 4
60
#  define UINT32_C(c) c l
61
# endif
62
#endif
63
 
64
#ifndef HAVE_UINT32_T
65
# if SIZEOF_INT == 4
66
typedef unsigned int uint32_t;
67
# elif SIZEOF_LONG == 4
68
typedef unsigned long uint32_t;
69
# else
70
#  error "Can't find a 32-bit type"
71
# endif
72
#endif
73
 
74
#ifndef HAVE_INT32_T
75
# if SIZEOF_INT == 4
76
typedef signed int int32_t;
77
# elif SIZEOF_LONG == 4
78
typedef signed long int32_t;
79
# endif
80
#endif
81
 
82
#ifndef HAVE_UINT16_T
83
# if SIZEOF_SHORT == 2
84
typedef unsigned short uint16_t;
85
# else
86
#  error "Can't find a 16-bit type"
87
# endif
88
#endif
89
 
90
#ifndef HAVE_INT16_T
91
# if SIZEOF_SHORT == 2
92
typedef signed short int16_t;
93
# endif
94
#endif
95
 
96
#ifndef HAVE_UINT8_T
97
# if SIZEOF_CHAR == 1
98
typedef unsigned char uint8_t;
99
# else
100
#  error "Can't find a 8-bit type"
101
# endif
102
#endif
103
 
104
#ifndef HAVE_INT8_T
105
# if SIZEOF_CHAR == 1
106
typedef signed char int8_t;
107
# endif
108
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.