Whamcloud - gitweb
Smallfix for building in x86_64.
authorliangzhen <liangzhen>
Wed, 1 Mar 2006 11:44:10 +0000 (11:44 +0000)
committerliangzhen <liangzhen>
Wed, 1 Mar 2006 11:44:10 +0000 (11:44 +0000)
lustre/include/linux/types.h
lustre/liblustre/dir.c
lustre/utils/liblustreapi.c
lustre/utils/platform.h

index 1adf66c..c09badf 100644 (file)
@@ -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
index 3a59da9..96806aa 100644 (file)
@@ -46,8 +46,8 @@
 
 #undef LIST_HEAD
 
-#ifdef HAVE_LINUX_TYPES_H
-#include <linux/types.h>
+#ifdef HAVE_ASM_TYPES_H
+#include <asm/types.h>
 #elif defined(HAVE_SYS_TYPES_H)
 #include <sys/types.h>
 #endif
index bf88a0c..2c10da6 100644 (file)
@@ -40,8 +40,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
-#ifdef HAVE_LINUX_TYPES_H
-#include <linux/types.h>
+#ifdef HAVE_ASM_TYPES_H
+#include <asm/types.h>
 #endif
 #ifdef HAVE_LINUX_UNISTD_H
 #include <linux/unistd.h>
index ba9a91f..4f5b5c9 100644 (file)
 #ifndef __LUSTRE_UTILS_PLATFORM_H
 #define __LUSTRE_UTILS_PLATFORM_H
 
+#ifdef __linux__
+
 #ifdef HAVE_LIBREADLINE
-# define READLINE_LIBRARY
-# include <readline/readline.h>
+#define READLINE_LIBRARY
+#include <readline/readline.h>
 
 /* 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 <errno.h>
 #include <string.h>
@@ -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 <readline/readline.h>
 typedef VFunction       rl_vintfunc_t;
 typedef VFunction       rl_voidfunc_t;
+#endif /* HAVE_LIBREADLINE */
 
 #include <stdlib.h>
 #include <errno.h>
@@ -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 <readline/readline.h>
 #endif /* HAVE_LIBREADLINE */
+#include <errno.h>
+#include <string.h>
+#if HAVE_LIBPTHREAD
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <pthread.h>
+
+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