replace __inline__ with inline in list.h

common.h has fixes for it where needed.
master
Ozkan Sezer 4 years ago
parent e68fe9d983
commit 6bbd64acbb
  1. 2
      src/common.h
  2. 26
      src/list.h

@ -3,7 +3,9 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#define PATH_MAX 1024 #define PATH_MAX 1024
#ifndef __cplusplus
#define inline __inline #define inline __inline
#endif
#define open _open #define open _open
#define close _close #define close _close
#define write _write #define write _write

@ -1,15 +1,9 @@
/* This is list.h from the Linux kernel */ /* This is list.h from the Linux kernel */
#ifndef XMP_LIST_H
#ifndef __LINUX_LIST_H #define XMP_LIST_H
#define __LINUX_LIST_H
#include <stddef.h> /* offsetof */ #include <stddef.h> /* offsetof */
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define __inline__ __inline
#endif
/* /*
* Simple doubly linked list implementation. * Simple doubly linked list implementation.
* *
@ -39,7 +33,7 @@ struct list_head {
* This is only for internal list manipulation where we know * This is only for internal list manipulation where we know
* the prev/next entries already! * 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 * prev,
struct list_head * next) 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. * Insert a new entry after the specified head.
* This is good for implementing stacks. * 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); __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. * Insert a new entry before the specified head.
* This is useful for implementing queues. * 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); __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 * This is only for internal list manipulation where we know
* the prev/next entries already! * 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) struct list_head * next)
{ {
next->prev = prev; next->prev = prev;
@ -93,7 +87,7 @@ static __inline__ void __list_del(struct list_head * prev,
* list_del - deletes entry from list. * list_del - deletes entry from list.
* @entry: the element to delete from the 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); __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 * list_empty - tests whether a list is empty
* @head: the list to test. * @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; return head->next == head;
} }
@ -112,7 +106,7 @@ static __inline__ int list_empty(struct list_head *head)
* @list: the new list to add. * @list: the new list to add.
* @head: the place to add it in the first list. * @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; 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) \ #define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next) for (pos = (head)->next; pos != (head); pos = pos->next)
#endif #endif /* XMP_LIST_H */

Loading…
Cancel
Save