From 9367fffad6bd98fcda0069d6fcac537b0588680b Mon Sep 17 00:00:00 2001 From: caro Date: Tue, 23 Mar 2010 06:41:17 +0000 Subject: [PATCH] fix most compilation errors with vc++ (there are still a problem with eina_log and output of the log messages: STDERR_FILENO, STDOUT_FILENO and isatty()) fix some warnings and header files inclusion update vcproj files git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@47384 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/include/eina_error.h | 1 - src/include/eina_log.h | 3 ++- src/lib/eina_log.c | 18 ++++++++++++------ src/lib/eina_module.c | 7 ++++++- src/lib/eina_safety_checks.c | 3 ++- src/lib/eina_str.c | 4 ++++ src/lib/eina_strbuf.c | 2 +- src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c | 6 +++--- win32/common/eina_config.h | 3 +++ win32/vs9/libeina.vcproj | 12 ++++++++++-- 10 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/include/eina_error.h b/src/include/eina_error.h index f1df1fb..7c119d4 100644 --- a/src/include/eina_error.h +++ b/src/include/eina_error.h @@ -22,7 +22,6 @@ #include #include "eina_types.h" -#include "eina_log.h" /** * @addtogroup Eina_Tools_Group Tools diff --git a/src/include/eina_log.h b/src/include/eina_log.h index b7b57ee..b42c1be 100644 --- a/src/include/eina_log.h +++ b/src/include/eina_log.h @@ -19,6 +19,7 @@ #ifndef EINA_LOG_H_ #define EINA_LOG_H_ +#include #include #include "eina_types.h" @@ -222,7 +223,7 @@ struct _Eina_Log_Domain int level; /**< Max level to log */ const char *domain_str; /**< Formatted string with color to print */ const char *name; /**< Domain name */ - unsigned int namelen; /**< strlen(name) */ + size_t namelen; /**< strlen(name) */ /* Private */ Eina_Bool deleted:1; /**< Flags deletion of domain, a free slot */ diff --git a/src/lib/eina_log.c b/src/lib/eina_log.c index e4d8dce..678a7b5 100644 --- a/src/lib/eina_log.c +++ b/src/lib/eina_log.c @@ -265,9 +265,12 @@ #include #include #include -#include #include +#ifndef _MSC_VER +# include +#endif + #ifdef EFL_HAVE_PTHREAD # include #endif @@ -315,7 +318,7 @@ struct _Eina_Log_Domain_Level_Pending { EINA_INLIST; unsigned int level; - unsigned int namelen; + size_t namelen; char name[]; }; @@ -394,7 +397,7 @@ static pthread_mutex_t _log_mutex = PTHREAD_MUTEX_INITIALIZER; // List of domains registered static Eina_Log_Domain *_log_domains = NULL; static unsigned int _log_domains_count = 0; -static unsigned int _log_domains_allocated = 0; +static size_t _log_domains_allocated = 0; // Default function for printing on domains static Eina_Log_Print_Cb _print_cb = eina_log_print_cb_stderr; @@ -839,7 +842,8 @@ static inline int eina_log_domain_register_unlocked(const char *name, const char *color) { Eina_Log_Domain_Level_Pending *pending = NULL; - unsigned int i, namelen; + size_t namelen; + unsigned int i; for (i = 0; i < _log_domains_count; i++) { @@ -1567,7 +1571,8 @@ EAPI void eina_log_domain_level_set(const char *domain_name, int level) { Eina_Log_Domain_Level_Pending *pending; - unsigned int i, namelen; + size_t namelen; + unsigned int i; EINA_SAFETY_ON_NULL_RETURN(domain_name); @@ -1627,7 +1632,8 @@ EAPI int eina_log_domain_level_get(const char *domain_name) { Eina_Log_Domain_Level_Pending *pending; - unsigned int i, namelen; + size_t namelen; + unsigned int i; EINA_SAFETY_ON_NULL_RETURN_VAL(domain_name, EINA_LOG_LEVEL_UNKNOWN); diff --git a/src/lib/eina_module.c b/src/lib/eina_module.c index 950e1f9..5f2ea02 100644 --- a/src/lib/eina_module.c +++ b/src/lib/eina_module.c @@ -45,7 +45,12 @@ void *alloca (size_t); #include #include #include -#include + +#ifndef _MSC_VER +# include +#else +# include +#endif #include diff --git a/src/lib/eina_safety_checks.c b/src/lib/eina_safety_checks.c index 7c8a7bc..d897be7 100644 --- a/src/lib/eina_safety_checks.c +++ b/src/lib/eina_safety_checks.c @@ -20,8 +20,9 @@ # include "config.h" #endif -#include "eina_error.h" #include "eina_private.h" +#include "eina_error.h" +#include "eina_log.h" #include "eina_safety_checks.h" /*============================================================================* diff --git a/src/lib/eina_str.c b/src/lib/eina_str.c index cfdb228..659a30e 100644 --- a/src/lib/eina_str.c +++ b/src/lib/eina_str.c @@ -38,6 +38,10 @@ # include #endif +#ifdef HAVE_EVIL +# include +#endif + #include "eina_private.h" #include "eina_str.h" diff --git a/src/lib/eina_strbuf.c b/src/lib/eina_strbuf.c index 91a128a..751608b 100644 --- a/src/lib/eina_strbuf.c +++ b/src/lib/eina_strbuf.c @@ -34,7 +34,7 @@ static const char EINA_MAGIC_STRBUF_STR[] = "Eina Strbuf"; EINA_MAGIC_FAIL((d), EINA_MAGIC_STRBUF); \ return __VA_ARGS__; \ } \ - } while (0); + } while (0) #define EINA_STRBUF_INIT_SIZE 32 #define EINA_STRBUF_INIT_STEP 32 diff --git a/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c b/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c index 992935b..fdc4f8a 100644 --- a/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c +++ b/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c @@ -83,8 +83,8 @@ _eina_fixed_cmp_key(const Eina_Rbtree *node, const void *key, __UNUSED__ int len { const void *a = node; const void *b = key; - int delta; - int limit; + ssize_t delta; + ssize_t limit; limit = sizeof (Eina_Fixed_Bitmap_Pool) + mp->item_size * 32; delta = (char *)a - (char *)b; @@ -150,7 +150,7 @@ eina_fixed_bitmap_free(void *data, void *ptr) Eina_Fixed_Bitmap_Pool *pool; void *a; Eina_Bool push_front = EINA_FALSE; - int delta; + ssize_t delta; pool = (Eina_Fixed_Bitmap_Pool*) eina_rbtree_inline_lookup(mp->lookup, ptr, 0, diff --git a/win32/common/eina_config.h b/win32/common/eina_config.h index 1e584ff..85e94a7 100644 --- a/win32/common/eina_config.h +++ b/win32/common/eina_config.h @@ -28,4 +28,7 @@ # define EINA_SAFETY_CHECKS #endif +#define MODULE_ARCH "win32-msc-x86" +#define SHARED_LIB_SUFFIX ".dll" + #endif /* EINA_CONFIG_H_ */ diff --git a/win32/vs9/libeina.vcproj b/win32/vs9/libeina.vcproj index f246b5f..f558e91 100644 --- a/win32/vs9/libeina.vcproj +++ b/win32/vs9/libeina.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="$(INCLUDE)" - PreprocessorDefinitions="HAVE_ERRNO_H;_WIN32_WINNT=0x0501;SECURITY_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_EVIL;DLL_EXPORT;snprintf=_snprintf_c;__CRT_INLINE=__inline;inline=__inline;__UNUSED__=;EFL_EINA_BUILD;PACKAGE_LIB_DIR=;_CRT_SECURE_NO_WARNINGS;EINA_STATIC_BUILD_CHAINED_POOL;EINA_STATIC_BUILD_PASS_THROUGH;EINA_STATIC_BUILD_FIXED_BITMAP;_POSIX_;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="HAVE_ERRNO_H;_WIN32_WINNT=0x0501;SECURITY_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_EVIL;DLL_EXPORT;snprintf=_snprintf_c;__CRT_INLINE=__inline;inline=__inline;__UNUSED__=;EFL_EINA_BUILD;PACKAGE_LIB_DIR=;_CRT_SECURE_NO_WARNINGS;EINA_STATIC_BUILD_BUDDY;EINA_STATIC_BUILD_CHAINED_POOL;EINA_STATIC_BUILD_PASS_THROUGH;EINA_STATIC_BUILD_FIXED_BITMAP;_POSIX_;_CRT_SECURE_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ + + @@ -426,6 +430,10 @@ > + + -- 2.7.4