URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 1350 |
Rev 1419 |
#ifndef __STRNDUP__
|
#ifndef __STRNDUP__
|
#define __STRNDUP__
|
#define __STRNDUP__
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
|
|
#if !defined(HAVE_STRNDUP)
|
#if !defined(HAVE_STRNDUP)
|
char * strndup (const char *s, size_t n);
|
char * strndup (const char *s, size_t n);
|
#endif
|
#endif
|
|
|
#endif
|
#endif
|
|
|
#ifndef HAS_ISBLANK
|
#ifndef HAS_ISBLANK
|
int isblank(int c);
|
int isblank(int c);
|
#endif
|
#endif
|
|
|
#ifndef PRIx32
|
#ifndef PRIx32
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
# define PRIx32 "x"
|
# define PRIx32 "x"
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
# define PRIx32 "lx"
|
# define PRIx32 "lx"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef PRIx16
|
#ifndef PRIx16
|
# if SIZEOF_SHORT == 2
|
# if SIZEOF_SHORT == 2
|
# define PRIx16 "hx"
|
# define PRIx16 "hx"
|
# else
|
# else
|
# define PRIx16 "x"
|
# define PRIx16 "x"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef PRIx8
|
#ifndef PRIx8
|
# if SIZEOF_CHAR == 1
|
# if SIZEOF_CHAR == 1
|
# define PRIx8 "hhx"
|
# define PRIx8 "hhx"
|
# else
|
# else
|
# define PRIx8 "x"
|
# define PRIx8 "x"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef PRIi32
|
#ifndef PRIi32
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
# define PRIi32 "i"
|
# define PRIi32 "i"
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
# define PRIi32 "li"
|
# define PRIi32 "li"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef PRId32
|
#ifndef PRId32
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
# define PRId32 "d"
|
# define PRId32 "d"
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
# define PRId32 "ld"
|
# define PRId32 "ld"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef UINT32_C
|
#ifndef UINT32_C
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
# define UINT32_C(c) c
|
# define UINT32_C(c) c
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
# define UINT32_C(c) c l
|
# define UINT32_C(c) c l
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_UINT32_T
|
#ifndef HAVE_UINT32_T
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
typedef unsigned long uint32_t;
|
typedef unsigned long uint32_t;
|
# else
|
# else
|
# error "Can't find a 32-bit type"
|
# error "Can't find a 32-bit type"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_INT32_T
|
#ifndef HAVE_INT32_T
|
# if SIZEOF_INT == 4
|
# if SIZEOF_INT == 4
|
typedef signed int int32_t;
|
typedef signed int int32_t;
|
# elif SIZEOF_LONG == 4
|
# elif SIZEOF_LONG == 4
|
typedef signed long int32_t;
|
typedef signed long int32_t;
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_UINT16_T
|
#ifndef HAVE_UINT16_T
|
# if SIZEOF_SHORT == 2
|
# if SIZEOF_SHORT == 2
|
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
# else
|
# else
|
# error "Can't find a 16-bit type"
|
# error "Can't find a 16-bit type"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_INT16_T
|
#ifndef HAVE_INT16_T
|
# if SIZEOF_SHORT == 2
|
# if SIZEOF_SHORT == 2
|
typedef signed short int16_t;
|
typedef signed short int16_t;
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_UINT8_T
|
#ifndef HAVE_UINT8_T
|
# if SIZEOF_CHAR == 1
|
# if SIZEOF_CHAR == 1
|
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
# else
|
# else
|
# error "Can't find a 8-bit type"
|
# error "Can't find a 8-bit type"
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
#ifndef HAVE_INT8_T
|
#ifndef HAVE_INT8_T
|
# if SIZEOF_CHAR == 1
|
# if SIZEOF_CHAR == 1
|
typedef signed char int8_t;
|
typedef signed char int8_t;
|
# endif
|
# endif
|
#endif
|
#endif
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.