Skip to content

Commit

Permalink
Merge pull request #166 from migthymax/165-dont-include-sdk-include-i…
Browse files Browse the repository at this point in the history
…n-the-public-include-fields-of-clib4

165 dont include sdk include in the public include fields of clib4
  • Loading branch information
afxgroup authored Mar 6, 2024
2 parents d708d1a + 4d99f8a commit 38fd8d6
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 32 deletions.
3 changes: 3 additions & 0 deletions library/include/dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include <wchar.h>
#include <setjmp.h>
#include <resolv.h>
#include <exec/types.h>
#include <exec/lists.h>
#include <exec/semaphores.h>

/* Category name handling variables. */
#define NUM_LOCALES (LC_MAX + 1)
Expand Down
2 changes: 0 additions & 2 deletions library/include/malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <stddef.h>
#include <stdio.h>
#include <exec/lists.h>
#include <exec/nodes.h>

#define SIZE_ALIGN (4 * sizeof(size_t))
#define SIZE_MASK (-SIZE_ALIGN)
Expand Down
26 changes: 4 additions & 22 deletions library/include/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <sys/types.h>
#include <sys/time.h>
#include <errno.h>
#include <exec/types.h>
#include <exec/semaphores.h>
#include <sched.h>
#include <features.h>

Expand Down Expand Up @@ -144,12 +142,7 @@ struct pthread_mutexattr {

typedef struct pthread_mutexattr pthread_mutexattr_t;

struct pthread_mutex {
APTR mutex;
int kind;
int incond;
struct Task *owner;
};
struct pthread_mutex;

typedef struct pthread_mutex pthread_mutex_t;

Expand All @@ -173,11 +166,7 @@ struct pthread_condattr {

typedef struct pthread_condattr pthread_condattr_t;

struct pthread_cond {
int pad1;
struct SignalSemaphore semaphore;
struct MinList waiters;
};
struct pthread_cond;

typedef struct pthread_cond pthread_cond_t;

Expand All @@ -195,12 +184,7 @@ struct pthread_barrierattr {

typedef struct pthread_barrierattr pthread_barrierattr_t;

struct pthread_barrier {
unsigned int curr_height;
unsigned int total_height;
pthread_cond_t breeched;
pthread_mutex_t lock;
};
struct pthread_barrier;

typedef struct pthread_barrier pthread_barrier_t;

Expand All @@ -214,9 +198,7 @@ struct pthread_rwlockattr {

typedef struct pthread_rwlockattr pthread_rwlockattr_t;

struct pthread_rwlock {
struct SignalSemaphore semaphore;
};
struct pthread_rwlock;

typedef struct pthread_rwlock pthread_rwlock_t;

Expand Down
9 changes: 1 addition & 8 deletions library/include/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@
#undef SEM_FAILED
#define SEM_FAILED ((sem_t *)(-1))

struct sema
{
struct Node node;
int value;
int waiters_count;
pthread_mutex_t lock;
pthread_cond_t count_nonzero;
};
struct sema;

typedef struct sema sem_t;

Expand Down
32 changes: 32 additions & 0 deletions library/pthread/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@
#include "pthread.h"
#include <sys/time.h>

struct pthread_mutex {
APTR mutex;
int kind;
int incond;
struct Task *owner;
};

struct pthread_cond {
int pad1;
struct SignalSemaphore semaphore;
struct MinList waiters;
};

struct pthread_barrier {
unsigned int curr_height;
unsigned int total_height;
pthread_cond_t breeched;
pthread_mutex_t lock;
};

struct pthread_rwlock {
struct SignalSemaphore semaphore;
};

struct sema {
struct Node node;
int value;
int waiters_count;
pthread_mutex_t lock;
pthread_cond_t count_nonzero;
};

#undef NEWLIST
#define NEWLIST(_l) \
do \
Expand Down
1 change: 1 addition & 0 deletions library/rt/aio_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <errno.h>
#include <pthread.h>

#include "../pthread/common.h"
#include "clist.h"

/* Used by aio functions */
Expand Down

0 comments on commit 38fd8d6

Please sign in to comment.