diff --git a/src/common.h b/src/common.h index 0ab4256..72ac6c7 100644 --- a/src/common.h +++ b/src/common.h @@ -3,7 +3,9 @@ #ifdef _MSC_VER #define PATH_MAX 1024 +#ifndef __cplusplus #define inline __inline +#endif #define open _open #define close _close #define write _write diff --git a/src/list.h b/src/list.h index 1516da5..e417646 100644 --- a/src/list.h +++ b/src/list.h @@ -1,15 +1,9 @@ - /* This is list.h from the Linux kernel */ - -#ifndef __LINUX_LIST_H -#define __LINUX_LIST_H +#ifndef XMP_LIST_H +#define XMP_LIST_H #include /* offsetof */ -#if defined(_MSC_VER) || defined(__WATCOMC__) -#define __inline__ __inline -#endif - /* * Simple doubly linked list implementation. * @@ -39,7 +33,7 @@ struct list_head { * This is only for internal list manipulation where we know * the prev/next entries already! */ -static __inline__ void __list_add(struct list_head *_new, +static inline void __list_add(struct list_head *_new, struct list_head * prev, struct list_head * next) { @@ -57,7 +51,7 @@ static __inline__ void __list_add(struct list_head *_new, * Insert a new entry after the specified head. * This is good for implementing stacks. */ -static __inline__ void list_add(struct list_head *_new, struct list_head *head) +static inline void list_add(struct list_head *_new, struct list_head *head) { __list_add(_new, head, head->next); } @@ -70,7 +64,7 @@ static __inline__ void list_add(struct list_head *_new, struct list_head *head) * Insert a new entry before the specified head. * This is useful for implementing queues. */ -static __inline__ void list_add_tail(struct list_head *_new, struct list_head *head) +static inline void list_add_tail(struct list_head *_new, struct list_head *head) { __list_add(_new, head->prev, head); } @@ -82,7 +76,7 @@ static __inline__ void list_add_tail(struct list_head *_new, struct list_head *h * This is only for internal list manipulation where we know * the prev/next entries already! */ -static __inline__ void __list_del(struct list_head * prev, +static inline void __list_del(struct list_head * prev, struct list_head * next) { next->prev = prev; @@ -93,7 +87,7 @@ static __inline__ void __list_del(struct list_head * prev, * list_del - deletes entry from list. * @entry: the element to delete from the list. */ -static __inline__ void list_del(struct list_head *entry) +static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } @@ -102,7 +96,7 @@ static __inline__ void list_del(struct list_head *entry) * list_empty - tests whether a list is empty * @head: the list to test. */ -static __inline__ int list_empty(struct list_head *head) +static inline int list_empty(struct list_head *head) { return head->next == head; } @@ -112,7 +106,7 @@ static __inline__ int list_empty(struct list_head *head) * @list: the new list to add. * @head: the place to add it in the first list. */ -static __inline__ void list_splice(struct list_head *list, struct list_head *head) +static inline void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; @@ -145,4 +139,4 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) -#endif +#endif /* XMP_LIST_H */