diff --git a/Makefile.cfg b/Makefile.cfg index 05b30a8..dd79ca0 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -45,9 +45,13 @@ MODEST_DIR_SEPARATOR ?= / # names # This variables used with "call" $(call MODEST_LIBRARY_WITH_VERSION), # for use actual variables like a LIB_NAME_SUFFIX -MODEST_LIBRARY ?= $(LIB_DIR_BASE)/lib$(LIB_NAME)$(LIB_NAME_SUFFIX) -MODEST_LIBRARY_STATIC ?= $(LIB_DIR_BASE)/lib$(LIB_NAME)$(LIB_NAME_SUFFIX_STATIC) -MODEST_LIBRARY_WITH_VERSION = $(LIB_DIR_BASE)/lib$(LIB_NAME).$(MODEST_VERSION_STRING)$(LIB_NAME_SUFFIX) +MODEST_LIBRARY_NAME ?= lib$(LIB_NAME)$(LIB_NAME_SUFFIX) +MODEST_LIBRARY_NAME_STATIC ?=lib$(LIB_NAME)$(LIB_NAME_SUFFIX_STATIC) +MODEST_LIBRARY_NAME_WITH_VERSION = lib$(LIB_NAME).$(MODEST_VERSION_STRING)$(LIB_NAME_SUFFIX) + +MODEST_LIBRARY ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME) +MODEST_LIBRARY_STATIC ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_STATIC) +MODEST_LIBRARY_WITH_VERSION = $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_WITH_VERSION) MODEST_PORT_NAME ?= posix diff --git a/examples/Makefile b/examples/Makefile index 2dab86f..7482c06 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -63,7 +63,7 @@ BINARY_BUILD_EXECUTE_CLEAN := $(foreach path,$(BINARY_BUILD_EXECUTE),$(subst ./, BINARY_BUILD_EXECUTE_TO_CLEAN := $(foreach path,$(BINARY_BUILD_EXECUTE_CLEAN),rm -f $(BINARY_TO_DIR)/$(path) $(BYNARY_UTILS_NEW_LINE)) BINARY_BUILD_DIRS_TO_CLEAN := $(foreach path,$(BINARY_BUILD_MODULES_LIST),rm -rf $(BINARY_TO_DIR)/$(path) $(BYNARY_UTILS_NEW_LINE)) BINARY_BUILD_EXECUTE_COPY := $(foreach path,$(BINARY_BUILD_EXECUTE_CLEAN),cp $(path) $(BINARY_TO_DIR)/$(dir $(path)) $(BYNARY_UTILS_NEW_LINE)) -BINARY_BUILD_EXECUTE_COPY_ALL := $(BINARY_UTILS_CREATE_DIRS) $(BINARY_BUILD_EXECUTE_COPY) +BINARY_BUILD_EXECUTE_COPY_ALL := $(BINARY_UTILS_CREATE_DIRS) $(BINARY_BUILD_EXECUTE_COPY) cp $(BINARY_PATH_RELATIVE)/$(call MODEST_LIBRARY_WITH_VERSION) $(BINARY_TO_DIR) #******************** # Target options @@ -76,6 +76,7 @@ build: $(BINARY_BUILD_EXECUTE_CLEAN) clean: $(BINARY_BUILD_MODULES_TARGET_CLEAN) $(BINARY_BUILD_EXECUTE_TO_CLEAN) $(BINARY_BUILD_DIRS_TO_CLEAN) + rm -f $(BINARY_TO_DIR)/$(call MODEST_LIBRARY_NAME_WITH_VERSION) copy: $(BINARY_BUILD_EXECUTE_COPY_ALL) diff --git a/include/mycore/myosi.h b/include/mycore/myosi.h index 99005a3..84a6e25 100644 --- a/include/mycore/myosi.h +++ b/include/mycore/myosi.h @@ -33,15 +33,10 @@ #define MyCORE_VERSION_MINOR 0 #define MyCORE_VERSION_PATCH 0 -#define MyCORE_BUILD_WITHOUT_THREADS +//#define MyCORE_BUILD_WITHOUT_THREADS #ifdef __cplusplus -//extern "C" { -#endif - -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WINPTHREADS_VERSION) -#define IS_OS_WINDOWS -#include +extern "C" { #endif /* Format */ diff --git a/include/mycore/mythread.h b/include/mycore/mythread.h index a168ac2..f7ef5e5 100644 --- a/include/mycore/mythread.h +++ b/include/mycore/mythread.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include diff --git a/include/mycore/thread_queue.h b/include/mycore/thread_queue.h index 6a4f991..e833b35 100644 --- a/include/mycore/thread_queue.h +++ b/include/mycore/thread_queue.h @@ -26,7 +26,7 @@ #include #ifdef __cplusplus -//extern "C" { +extern "C" { #endif // queue diff --git a/include/mycore/utils/mhash.h b/include/mycore/utils/mhash.h index 6f7902d..0d968f7 100644 --- a/include/mycore/utils/mhash.h +++ b/include/mycore/utils/mhash.h @@ -21,6 +21,8 @@ #ifndef MyCORE_UTILS_MHASH_H #define MyCORE_UTILS_MHASH_H +#include + #include #include diff --git a/include/mycss/media/myosi.h b/include/mycss/media/myosi.h index ef45cc3..f026fae 100644 --- a/include/mycss/media/myosi.h +++ b/include/mycss/media/myosi.h @@ -32,6 +32,7 @@ typedef struct mycss_media mycss_media_t; struct mycss_media { + mystatus_t error; }; diff --git a/include/myencoding/encoding.h b/include/myencoding/encoding.h index 8247308..e14911c 100644 --- a/include/myencoding/encoding.h +++ b/include/myencoding/encoding.h @@ -23,9 +23,11 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif +#include + #include #include #include diff --git a/include/myencoding/myosi.h b/include/myencoding/myosi.h index e9ab80d..45d1328 100644 --- a/include/myencoding/myosi.h +++ b/include/myencoding/myosi.h @@ -29,7 +29,7 @@ #define MyENCODING_VERSION_PATCH 0 #ifdef __cplusplus -//extern "C" { +extern "C" { #endif // encoding diff --git a/include/myencoding/mystring.h b/include/myencoding/mystring.h index bc347a7..771b0ef 100644 --- a/include/myencoding/mystring.h +++ b/include/myencoding/mystring.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include diff --git a/include/myfont/myfont.h b/include/myfont/myfont.h index f8ce657..172074e 100644 --- a/include/myfont/myfont.h +++ b/include/myfont/myfont.h @@ -22,6 +22,8 @@ #define MyFONT_MyFONT_H #pragma once +#include + #include #include #include diff --git a/include/myhtml/mystring.h b/include/myhtml/mystring.h index 3275f95..caa8eb9 100644 --- a/include/myhtml/mystring.h +++ b/include/myhtml/mystring.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include diff --git a/source/modest/finder/pseudo_class.c b/source/modest/finder/pseudo_class.c index 335dc4c..7847a9e 100644 --- a/source/modest/finder/pseudo_class.c +++ b/source/modest/finder/pseudo_class.c @@ -159,7 +159,7 @@ bool modest_finder_selector_sub_type_pseudo_class_function_nth_child_check_selec bool modest_finder_selector_sub_type_pseudo_class_function_nth_child(modest_finder_t* finder, myhtml_tree_node_t* base_node, mycss_selectors_entry_t* selector, mycss_selectors_specificity_t* spec) { if(selector->value == NULL) - return NULL; + return false; mycss_an_plus_b_entry_t *anb = mycss_selector_value_an_plus_b(selector->value); @@ -226,7 +226,7 @@ bool modest_finder_selector_sub_type_pseudo_class_function_nth_column(modest_fin bool modest_finder_selector_sub_type_pseudo_class_function_nth_last_child(modest_finder_t* finder, myhtml_tree_node_t* base_node, mycss_selectors_entry_t* selector, mycss_selectors_specificity_t* spec) { if(selector->value == NULL) - return NULL; + return false; mycss_an_plus_b_entry_t *anb = mycss_selector_value_an_plus_b(selector->value); @@ -290,7 +290,7 @@ bool modest_finder_selector_sub_type_pseudo_class_function_nth_last_column(modes bool modest_finder_selector_sub_type_pseudo_class_function_nth_last_of_type(modest_finder_t* finder, myhtml_tree_node_t* base_node, mycss_selectors_entry_t* selector, mycss_selectors_specificity_t* spec) { if(selector->value == NULL) - return NULL; + return false; mycss_an_plus_b_entry_t *anb = mycss_selector_value_an_plus_b(selector->value); @@ -322,7 +322,7 @@ bool modest_finder_selector_sub_type_pseudo_class_function_nth_last_of_type(mode bool modest_finder_selector_sub_type_pseudo_class_function_nth_of_type(modest_finder_t* finder, myhtml_tree_node_t* base_node, mycss_selectors_entry_t* selector, mycss_selectors_specificity_t* spec) { if(selector->value == NULL) - return NULL; + return false; mycss_an_plus_b_entry_t *anb = mycss_selector_value_an_plus_b(selector->value); diff --git a/source/mycore/myosi.h b/source/mycore/myosi.h index 4977fcf..84a6e25 100644 --- a/source/mycore/myosi.h +++ b/source/mycore/myosi.h @@ -36,7 +36,7 @@ //#define MyCORE_BUILD_WITHOUT_THREADS #ifdef __cplusplus -//extern "C" { +extern "C" { #endif /* Format */ diff --git a/source/mycore/mythread.h b/source/mycore/mythread.h index c44ac47..79434a8 100644 --- a/source/mycore/mythread.h +++ b/source/mycore/mythread.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include "mycore/myosi.h" diff --git a/source/mycore/thread_queue.h b/source/mycore/thread_queue.h index 7311714..789b708 100644 --- a/source/mycore/thread_queue.h +++ b/source/mycore/thread_queue.h @@ -26,7 +26,7 @@ #include "mycore/mythread.h" #ifdef __cplusplus -//extern "C" { +extern "C" { #endif // queue diff --git a/source/mycss/media/myosi.h b/source/mycss/media/myosi.h index 10a55af..2179932 100644 --- a/source/mycss/media/myosi.h +++ b/source/mycss/media/myosi.h @@ -32,6 +32,7 @@ typedef struct mycss_media mycss_media_t; struct mycss_media { + mystatus_t error; }; diff --git a/source/myencoding/myosi.h b/source/myencoding/myosi.h index ad09f8e..61fa87c 100644 --- a/source/myencoding/myosi.h +++ b/source/myencoding/myosi.h @@ -29,7 +29,7 @@ #define MyENCODING_VERSION_PATCH 0 #ifdef __cplusplus -//extern "C" { +extern "C" { #endif // encoding diff --git a/source/myencoding/mystring.h b/source/myencoding/mystring.h index 38f7f75..49ce8b6 100644 --- a/source/myencoding/mystring.h +++ b/source/myencoding/mystring.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include "myencoding/myosi.h" diff --git a/source/myhtml/mystring.h b/source/myhtml/mystring.h index bdef549..2906d59 100644 --- a/source/myhtml/mystring.h +++ b/source/myhtml/mystring.h @@ -23,7 +23,7 @@ #pragma once #ifdef __cplusplus -//extern "C" { +extern "C" { #endif #include "myhtml/myosi.h" diff --git a/source/myport/posix/mycore/thread.c b/source/myport/posix/mycore/thread.c index d4e753b..cb4a4ef 100644 --- a/source/myport/posix/mycore/thread.c +++ b/source/myport/posix/mycore/thread.c @@ -31,9 +31,9 @@ ***********************************************************************************/ void * mythread_thread_create(mythread_t *mythread, void* process_func, void* ctx) { - pthread_t thread; + void *thread = mycore_calloc(1, sizeof(pthread_t)); - if(pthread_create(&thread, mythread->attr, process_func, ctx) == 0) + if(pthread_create(&(*((pthread_t*)thread)), mythread->attr, process_func, ctx) == 0) return thread; return NULL; diff --git a/source/myport/windows_nt/mycore/io.c b/source/myport/windows_nt/mycore/io.c index 9dac45c..5ae1525 100644 --- a/source/myport/windows_nt/mycore/io.c +++ b/source/myport/windows_nt/mycore/io.c @@ -22,7 +22,7 @@ #include /* FILE */ -FILE * mycore_fopen(const char *restrict filename, const char *restrict mode) +FILE * mycore_fopen(const char* filename, const char* mode) { return fopen(filename, mode); } @@ -32,12 +32,12 @@ int mycore_fclose(FILE *stream) return fclose(stream); } -size_t mycore_fread(void *restrict buffer, size_t size, size_t count, FILE *restrict stream) +size_t mycore_fread(void *buffer, size_t size, size_t count, FILE* stream) { return fread(buffer, size, count, stream); } -size_t mycore_fwrite(const void *restrict buffer, size_t size, size_t count, FILE *restrict stream) +size_t mycore_fwrite(const void* buffer, size_t size, size_t count, FILE* stream) { return fwrite(buffer, size, count, stream); } @@ -53,9 +53,9 @@ int mycore_ferror(FILE *stream) } /* setbuf */ -void mycore_setbuf(FILE *restrict stream, char *restrict buffer) +void mycore_setbuf(FILE* stream, char* buffer) { - return setbuf(stream, buffer); + setbuf(stream, buffer); } diff --git a/source/myport/windows_nt/mycore/thread.c b/source/myport/windows_nt/mycore/thread.c index b2c1a8f..d914cf3 100644 --- a/source/myport/windows_nt/mycore/thread.c +++ b/source/myport/windows_nt/mycore/thread.c @@ -64,7 +64,7 @@ mystatus_t mythread_thread_destroy(mythread_t *mythread, void* thread) void * mythread_thread_attr_init(mythread_t *mythread) { - return MyCORE_STATUS_OK; + return (void*)0x01; } void mythread_thread_attr_clean(mythread_t *mythread, void* attr) @@ -111,7 +111,7 @@ void mythread_mutex_close(mythread_t *mythread, void* mutex) void * mythread_nanosleep_create(mythread_t* mythread) { - return NULL; + return (void*)0x01; } void mythread_nanosleep_clean(void* timespec) @@ -125,7 +125,7 @@ void mythread_nanosleep_destroy(void* timespec) mystatus_t mythread_nanosleep_sleep(void* timespec) { Sleep(0); - return MyCORE_STATUS_ERROR; + return MyCORE_STATUS_OK; } #endif diff --git a/source/myport/windows_nt/mycore/utils/mcsync.c b/source/myport/windows_nt/mycore/utils/mcsync.c index 5d7054c..4062c75 100644 --- a/source/myport/windows_nt/mycore/utils/mcsync.c +++ b/source/myport/windows_nt/mycore/utils/mcsync.c @@ -69,7 +69,7 @@ mcsync_status_t mcsync_spin_unlock(void* spinlock) /* mutex */ void * mcsync_mutex_create(void) { - return CreateSemaphore(NULL, 0, 1, NULL); + return CreateSemaphore(NULL, 1, 1, NULL); } mcsync_status_t mcsync_mutex_init(void* mutex)