version 1.1.1.3, 2012/10/09 09:29:52
|
version 1.1.1.4, 2013/07/22 10:46:12
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (c) 1996, 1998-2005, 2008, 2009-2010 | * Copyright (c) 1996, 1998-2005, 2008, 2009-2013 |
* Todd C. Miller <Todd.Miller@courtesan.com> |
* Todd C. Miller <Todd.Miller@courtesan.com> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
Line 52
|
Line 52
|
# endif |
# endif |
#endif |
#endif |
|
|
|
/* Hint to compiler that returned pointer is unique (malloc but not realloc). */ |
|
#ifndef __malloc_like |
|
# if __GNUC_PREREQ__(2, 96) |
|
# define __malloc_like __attribute__((__malloc__)) |
|
# else |
|
# define __malloc_like |
|
# endif |
|
#endif |
|
|
#ifndef __dso_public |
#ifndef __dso_public |
# ifdef HAVE_DSO_VISIBILITY |
# ifdef HAVE_DSO_VISIBILITY |
# if defined(__GNUC__) |
# if defined(__GNUC__) |
Line 82
|
Line 91
|
#endif |
#endif |
|
|
#ifndef PATH_MAX |
#ifndef PATH_MAX |
# ifdef MAXPATHLEN | # ifdef _POSIX_PATH_MAX |
# define PATH_MAX MAXPATHLEN | # define PATH_MAX _POSIX_PATH_MAX |
# else |
# else |
# ifdef _POSIX_PATH_MAX | # define PATH_MAX 256 |
# define PATH_MAX _POSIX_PATH_MAX | |
# else | |
# define PATH_MAX 1024 | |
# endif | |
# endif |
# endif |
#endif |
#endif |
|
|
#ifndef MAXHOSTNAMELEN | #ifndef HOST_NAME_MAX |
# define MAXHOSTNAMELEN 64 | # ifdef _POSIX_HOST_NAME_MAX |
| # define HOST_NAME_MAX _POSIX_HOST_NAME_MAX |
| # else |
| # define HOST_NAME_MAX 255 |
| # endif |
#endif |
#endif |
|
|
/* |
/* |
Line 140
|
Line 149
|
#endif |
#endif |
|
|
/* |
/* |
* BSD defines these in <sys/param.h> but others may not. | * BSD defines these in <sys/param.h> but we don't include that anymore. |
*/ |
*/ |
#ifndef MIN |
#ifndef MIN |
# define MIN(a,b) (((a)<(b))?(a):(b)) |
# define MIN(a,b) (((a)<(b))?(a):(b)) |
Line 149
|
Line 158
|
# define MAX(a,b) (((a)>(b))?(a):(b)) |
# define MAX(a,b) (((a)>(b))?(a):(b)) |
#endif |
#endif |
|
|
|
/* Macros to set/clear/test flags. */ |
|
#undef SET |
|
#define SET(t, f) ((t) |= (f)) |
|
#undef CLR |
|
#define CLR(t, f) ((t) &= ~(f)) |
|
#undef ISSET |
|
#define ISSET(t, f) ((t) & (f)) |
|
|
/* |
/* |
|
* Some systems define this in <sys/param.h> but we don't include that anymore. |
|
*/ |
|
#ifndef howmany |
|
# define howmany(x, y) (((x) + ((y) - 1)) / (y)) |
|
#endif |
|
|
|
/* |
* Older systems may be missing stddef.h and/or offsetof macro |
* Older systems may be missing stddef.h and/or offsetof macro |
*/ |
*/ |
#ifndef offsetof |
#ifndef offsetof |
Line 224 typedef struct sigaction sigaction_t;
|
Line 248 typedef struct sigaction sigaction_t;
|
#ifndef HAVE_GETPROGNAME |
#ifndef HAVE_GETPROGNAME |
# ifdef HAVE___PROGNAME |
# ifdef HAVE___PROGNAME |
extern const char *__progname; |
extern const char *__progname; |
# define getprogname() (__progname) | # define getprogname() (__progname) |
# else |
# else |
const char *getprogname(void); |
const char *getprogname(void); |
void setprogname(const char *); |
void setprogname(const char *); |
#endif /* HAVE___PROGNAME */ | # endif /* HAVE___PROGNAME */ |
#endif /* !HAVE_GETPROGNAME */ |
#endif /* !HAVE_GETPROGNAME */ |
|
|
/* |
/* |