From 3935640c166ed7a7ee9aaff0abc099930e651609 Mon Sep 17 00:00:00 2001 From: liangzhen Date: Wed, 1 Mar 2006 11:44:10 +0000 Subject: [PATCH] Smallfix for building in x86_64. --- lustre/include/linux/types.h | 5 +++-- lustre/liblustre/dir.c | 4 ++-- lustre/utils/liblustreapi.c | 4 ++-- lustre/utils/platform.h | 45 +++++++++++++++++++++++++++++++++++--------- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/lustre/include/linux/types.h b/lustre/include/linux/types.h index 1adf66c0..c09badf 100644 --- a/lustre/include/linux/types.h +++ b/lustre/include/linux/types.h @@ -1,11 +1,12 @@ #ifndef _LUSTRE_LINUX_TYPES_H #define _LUSTRE_LINUX_TYPES_H -typedef unsigned short umode_t; #if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ - !defined(_EXT2_TYPES_H) && !defined(_I386_TYPES_H)) + !defined(_EXT2_TYPES_H) && !defined(_I386_TYPES_H) && \ + !defined(_X86_64_TYPES_H)) +typedef unsigned short umode_t; /* * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space diff --git a/lustre/liblustre/dir.c b/lustre/liblustre/dir.c index 3a59da9..96806aa 100644 --- a/lustre/liblustre/dir.c +++ b/lustre/liblustre/dir.c @@ -46,8 +46,8 @@ #undef LIST_HEAD -#ifdef HAVE_LINUX_TYPES_H -#include +#ifdef HAVE_ASM_TYPES_H +#include #elif defined(HAVE_SYS_TYPES_H) #include #endif diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index bf88a0c..2c10da6 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -40,8 +40,8 @@ #include #include #include -#ifdef HAVE_LINUX_TYPES_H -#include +#ifdef HAVE_ASM_TYPES_H +#include #endif #ifdef HAVE_LINUX_UNISTD_H #include diff --git a/lustre/utils/platform.h b/lustre/utils/platform.h index ba9a91f..4f5b5c9 100644 --- a/lustre/utils/platform.h +++ b/lustre/utils/platform.h @@ -22,19 +22,21 @@ #ifndef __LUSTRE_UTILS_PLATFORM_H #define __LUSTRE_UTILS_PLATFORM_H +#ifdef __linux__ + #ifdef HAVE_LIBREADLINE -# define READLINE_LIBRARY -# include +#define READLINE_LIBRARY +#include /* completion_matches() is #if 0-ed out in modern glibc */ -# ifdef __linux__ -# ifndef completion_matches -# define completion_matches rl_completion_matches -# endif +#ifndef completion_matches +# define completion_matches rl_completion_matches +#endif extern void using_history(void); extern void stifle_history(int); extern void add_history(char *); +#endif /* HAVE_LIBREADLINE */ #include #include @@ -53,9 +55,14 @@ typedef pthread_cond_t l_cond_t; #define l_cond_wait(c, s) pthread_cond_wait(c, s) #endif -# elif __APPLE__ +#elif __APPLE__ + +#ifdef HAVE_LIBREADLINE +#define READLINE_LIBRARY +#include typedef VFunction rl_vintfunc_t; typedef VFunction rl_voidfunc_t; +#endif /* HAVE_LIBREADLINE */ #include #include @@ -213,9 +220,29 @@ static inline void l_cond_broadcast(l_cond_t *cond) l_mutex_unlock(&cond->c_guard); } -# else -# endif /* __APPLE__ */ +#else /* other platform */ +#ifdef HAVE_LIBREADLINE +#define READLINE_LIBRARY +#include #endif /* HAVE_LIBREADLINE */ +#include +#include +#if HAVE_LIBPTHREAD +#include +#include +#include + +typedef pthread_mutex_t l_mutex_t; +typedef pthread_cond_t l_cond_t; +#define l_mutex_init(s) pthread_mutex_init(s, NULL) +#define l_mutex_lock(s) pthread_mutex_lock(s) +#define l_mutex_unlock(s) pthread_mutex_unlock(s) +#define l_cond_init(c) pthread_cond_init(c, NULL) +#define l_cond_broadcast(c) pthread_cond_broadcast(c) +#define l_cond_wait(c, s) pthread_cond_wait(c, s) +#endif /* HAVE_LIBPTHREAD */ + +#endif /* __linux__ */ #endif -- 1.8.3.1