diff options
| author | bubulle <bubulle@alioth.debian.org> | 2010-09-06 20:54:34 +0000 |
|---|---|---|
| committer | bubulle <bubulle@alioth.debian.org> | 2010-09-06 20:54:34 +0000 |
| commit | 53601faba8f69c3454ad07acaceeef9165cb3743 (patch) | |
| tree | b31a4174a7f4d2650717c1902a6bc3f922e13117 /lib/replace/replace.h | |
| parent | 1b77db997b6a2ce389356509415a6e5e540bcfe0 (diff) | |
| download | samba-53601faba8f69c3454ad07acaceeef9165cb3743.tar.gz | |
Merge 3.5.4 in upstream branch
git-svn-id: svn://svn.debian.org/svn/pkg-samba/branches/samba/upstream@3574 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'lib/replace/replace.h')
| -rw-r--r-- | lib/replace/replace.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/replace/replace.h b/lib/replace/replace.h index c5b8676acf..6424d10c0f 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -258,6 +258,10 @@ char *rep_realpath(const char *path, char *resolved_path); int rep_lchown(const char *fname,uid_t uid,gid_t gid); #endif +#ifdef HAVE_UNIX_H +#include <unix.h> +#endif + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); @@ -535,6 +539,18 @@ typedef int bool; #endif #endif +#if !defined(HAVE_INTPTR_T) +typedef long long intptr_t ; +#endif + +#if !defined(HAVE_UINTPTR_T) +typedef unsigned long long uintptr_t ; +#endif + +#if !defined(HAVE_PTRDIFF_T) +typedef unsigned long long ptrdiff_t ; +#endif + /* * to prevent <rpcsvc/yp_prot.h> from doing a redefine of 'bool' * @@ -688,4 +704,23 @@ char *ufc_crypt(const char *key, const char *salt); #endif #endif +/* these macros gain us a few percent of speed on gcc */ +#if (__GNUC__ >= 3) +/* the strange !! is to ensure that __builtin_expect() takes either 0 or 1 + as its first argument */ +#ifndef likely +#define likely(x) __builtin_expect(!!(x), 1) +#endif +#ifndef unlikely +#define unlikely(x) __builtin_expect(!!(x), 0) +#endif +#else +#ifndef likely +#define likely(x) (x) +#endif +#ifndef unlikely +#define unlikely(x) (x) +#endif +#endif + #endif /* _LIBREPLACE_REPLACE_H */ |
