Add internal configuration file, add missing includes, rename some options
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_BUFFER_H
|
||||
#define BH_BUFFER_H
|
||||
|
||||
#include "bh.h"
|
||||
#include "io.h"
|
||||
|
||||
typedef struct bh_buffer_s bh_buffer_t;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef BH_CONFIG_H
|
||||
#define BH_CONFIG_H
|
||||
|
||||
#cmakedefine BH_USE_WINTHREAD
|
||||
#cmakedefine BH_USE_PTHREAD
|
||||
#cmakedefine BH_NO_WINXP
|
||||
#cmakedefine BH_PLATFORM_POSIX
|
||||
#cmakedefine BH_PLATFORM_WIN
|
||||
#cmakedefine BH_PLATFORM_THREADS
|
||||
|
||||
#endif /* BH_CONFIG_H */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifndef BH_DEFLATE_H
|
||||
#define BH_DEFLATE_H
|
||||
|
||||
#include "bh.h"
|
||||
|
||||
#endif /* BH_DEFLATE_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_FILE_H
|
||||
#define BH_FILE_H
|
||||
|
||||
#include "bh.h"
|
||||
#include "io.h"
|
||||
|
||||
typedef struct bh_file_s bh_file_t;
|
||||
|
||||
7
include/bh/internal/bh.h
Normal file
7
include/bh/internal/bh.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef BH_INTERNAL_H
|
||||
#define BH_INTERNAL_H
|
||||
|
||||
#include <bh/bh.h>
|
||||
#include <bh/internal/config.h>
|
||||
|
||||
#endif /* BH_INTERNAL_H */
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_BUFFER_H
|
||||
#define BH_INTERNAL_BUFFER_H
|
||||
|
||||
#include "bh.h"
|
||||
#include <bh/buffer.h>
|
||||
|
||||
struct bh_buffer_s
|
||||
|
||||
6
include/bh/internal/config.in
Normal file
6
include/bh/internal/config.in
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef BH_INTERNAL_CONFIG_H
|
||||
#define BH_INTERNAL_CONFIG_H
|
||||
|
||||
#cmakedefine BH_THREADS_WINXP
|
||||
|
||||
#endif /* BH_INTERNAL_CONFIG_H */
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_FILE_H
|
||||
#define BH_INTERNAL_FILE_H
|
||||
|
||||
#include "bh.h"
|
||||
#include "io.h"
|
||||
#include <bh/file.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_HASHMAP_H
|
||||
#define BH_INTERNAL_HASHMAP_H
|
||||
|
||||
#include "bh.h"
|
||||
#include <bh/hashmap.h>
|
||||
|
||||
typedef struct bh_hashmap_node_s
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_IO_H
|
||||
#define BH_INTERNAL_IO_H
|
||||
|
||||
#include "bh.h"
|
||||
#include <bh/io.h>
|
||||
|
||||
void bh_io_init(bh_io_t *io,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_QUEUE_H
|
||||
#define BH_INTERNAL_QUEUE_H
|
||||
|
||||
#include "bh.h"
|
||||
#include <bh/queue.h>
|
||||
|
||||
struct bh_queue_s
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_INTERNAL_THREAD_H
|
||||
#define BH_INTERNAL_THREAD_H
|
||||
|
||||
#include "bh.h"
|
||||
#include <bh/thread.h>
|
||||
#include "queue.h"
|
||||
|
||||
@@ -8,9 +9,9 @@
|
||||
|
||||
#define BH_MAX_TLS 32
|
||||
|
||||
#if defined(BH_USE_PTHREAD)
|
||||
#if defined(BH_PLATFORM_POSIX) && defined(BH_PLATFORM_THREADS)
|
||||
#include "thread_posix.h"
|
||||
#elif defined(BH_USE_WINTHREAD)
|
||||
#elif defined(BH_PLATFORM_WIN) && defined(BH_PLATFORM_THREADS)
|
||||
#include "thread_win.h"
|
||||
#else
|
||||
#include "thread_null.h"
|
||||
|
||||
@@ -14,12 +14,7 @@ typedef struct bh_task_s bh_task_t;
|
||||
typedef struct bh_thread_pool_s bh_thread_pool_t;
|
||||
typedef struct bh_spinlock_s bh_spinlock_t;
|
||||
|
||||
#if defined(BH_USE_PTHREAD)
|
||||
bh_thread_t *bh_thread_new(bh_task_t *task);
|
||||
|
||||
bh_thread_pool_t *bh_thread_pool_new(size_t size);
|
||||
|
||||
#elif defined(BH_USE_WINTHREAD)
|
||||
#if defined(BH_PLATFORM_WIN) && defined(BH_PLATFORM_THREADS)
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
@@ -46,6 +41,10 @@ bh_thread_pool_t *bh_thread_pool_new_base(size_t size,
|
||||
#define bh_thread_pool_new(size) \
|
||||
bh_thread_pool_new_base((size), _beginthreadex, _endthreadex);
|
||||
|
||||
#elif defined(BH_PLATFORM_THREADS)
|
||||
bh_thread_t *bh_thread_new(bh_task_t *task);
|
||||
|
||||
bh_thread_pool_t *bh_thread_pool_new(size_t size);
|
||||
#endif
|
||||
|
||||
bh_task_t *bh_task_new(void (*func)(void *),
|
||||
|
||||
Reference in New Issue
Block a user