From 60ea011e8debc9f994fced52f21ba6fdbf327486 Mon Sep 17 00:00:00 2001 From: caro Date: Sat, 14 May 2011 18:30:43 +0000 Subject: [PATCH] Ecore: ecore_con : make ecore_ipc compile on Windows. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@59389 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 1 + configure.ac | 7 ++++--- src/lib/ecore_ipc/Ecore_Ipc.h | 18 ++++++++++-------- src/lib/ecore_ipc/Makefile.am | 4 +++- src/lib/ecore_ipc/ecore_ipc.c | 15 +++++++++++---- src/lib/ecore_ipc/ecore_ipc_private.h | 23 ++++++++++------------- 6 files changed, 39 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9266d94..b26b72f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -181,3 +181,4 @@ * Make ecore_con work on Windows (only the local connections need a port) + * Make ecore_ipc compile on Windows diff --git a/configure.ac b/configure.ac index aabb223..d6c39dc 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,7 @@ want_glib="no" # core modules want_ecore_con="yes" -want_ecore_ipc="no" +want_ecore_ipc="yes" want_ecore_file="yes" #want_ecore_config="no" want_ecore_imf="no" @@ -165,6 +165,7 @@ want_ecore_evas_software_16_wince="no" case "$host_os" in mingw32ce* | cegcc*) want_ecore_con="no" + want_ecore_ipc="no" want_ecore_wince="yes" want_ecore_evas_software_16_wince="yes" ;; @@ -187,7 +188,6 @@ case "$host_os" in want_glib="auto" want_gnutls="auto" want_openssl="auto" - want_ecore_ipc="yes" want_ecore_imf="yes" want_ecore_cocoa="yes" want_ecore_evas_software_sdl="yes" @@ -204,7 +204,6 @@ case "$host_os" in want_inotify="yes" want_tslib="yes" want_ecore_fb="yes" - want_ecore_ipc="yes" want_ecore_imf="yes" want_ecore_x="yes" want_ecore_evas_software_x11="yes" @@ -367,6 +366,7 @@ case "$host_os" in EFL_ECORE_IMF_EVAS_BUILD="-DEFL_ECORE_IMF_EVAS_BUILD" EFL_ECORE_INPUT_BUILD="-DEFL_ECORE_INPUT_BUILD" EFL_ECORE_INPUT_EVAS_BUILD="-DEFL_ECORE_INPUT_EVAS_BUILD" + EFL_ECORE_IPC_BUILD="-DEFL_ECORE_IPC_BUILD" ;; esac @@ -395,6 +395,7 @@ AC_SUBST(EFL_ECORE_IMF_BUILD) AC_SUBST(EFL_ECORE_IMF_EVAS_BUILD) AC_SUBST(EFL_ECORE_INPUT_BUILD) AC_SUBST(EFL_ECORE_INPUT_EVAS_BUILD) +AC_SUBST(EFL_ECORE_IPC_BUILD) AC_SUBST(EFL_ECORE_WINCE_BUILD) AC_SUBST(EFL_ECORE_WIN32_BUILD) AC_SUBST(EFL_ECORE_SDL_BUILD) diff --git a/src/lib/ecore_ipc/Ecore_Ipc.h b/src/lib/ecore_ipc/Ecore_Ipc.h index 000fca9..fa12b40 100644 --- a/src/lib/ecore_ipc/Ecore_Ipc.h +++ b/src/lib/ecore_ipc/Ecore_Ipc.h @@ -5,9 +5,13 @@ # undef EAPI #endif -#ifdef _MSC_VER -# ifdef BUILDING_DLL -# define EAPI __declspec(dllexport) +#ifdef _WIN32 +# ifdef EFL_ECORE_IPC_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif # else # define EAPI __declspec(dllimport) # endif @@ -31,11 +35,9 @@ #ifdef __cplusplus extern "C" { #endif - -#ifndef _ECORE_IPC_PRIVATE_H - typedef void Ecore_Ipc_Server; /**< An IPC connection handle */ - typedef void Ecore_Ipc_Client; /**< An IPC connection handle */ -#endif + +typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; /**< An IPC connection handle */ +typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; /**< An IPC connection handle */ /** * Macros used for generic data packing diff --git a/src/lib/ecore_ipc/Makefile.am b/src/lib/ecore_ipc/Makefile.am index 03b392d..9cbed43 100644 --- a/src/lib/ecore_ipc/Makefile.am +++ b/src/lib/ecore_ipc/Makefile.am @@ -7,7 +7,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib/ecore \ -I$(top_srcdir)/src/lib/ecore_con \ -I$(top_srcdir)/src/lib/ecore_ipc \ -@SSL_CFLAGS@ @EINA_CFLAGS@ +@EFL_ECORE_IPC_BUILD@ \ +@SSL_CFLAGS@ \ +@EINA_CFLAGS@ lib_LTLIBRARIES = libecore_ipc.la includes_HEADERS = Ecore_Ipc.h diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index 4024280..c9819e7 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -13,11 +13,18 @@ # include #endif -#include "Ecore.h" -#include "ecore_private.h" -#include "Ecore_Con.h" -#include "ecore_ipc_private.h" +#if USE_GNUTLS_OPENSSL +# include +#elif USE_OPENSSL +# include +#endif + +#include +#include +#include + #include "Ecore_Ipc.h" +#include "ecore_ipc_private.h" #define DLT_ZERO 0 #define DLT_ONE 1 diff --git a/src/lib/ecore_ipc/ecore_ipc_private.h b/src/lib/ecore_ipc/ecore_ipc_private.h index b46f62b..57f7849 100644 --- a/src/lib/ecore_ipc/ecore_ipc_private.h +++ b/src/lib/ecore_ipc/ecore_ipc_private.h @@ -34,20 +34,21 @@ extern int _ecore_ipc_log_dom; #endif #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_ipc_log_dom, __VA_ARGS__) -#if USE_GNUTLS_OPENSSL -# include -#elif USE_OPENSSL -# include -#endif - #define ECORE_MAGIC_IPC_SERVER 0x87786556 #define ECORE_MAGIC_IPC_CLIENT 0x78875665 -typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; -typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; typedef struct _Ecore_Ipc_Msg_Head Ecore_Ipc_Msg_Head; +#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack(1) +# define ECORE_IPC_STRUCT_PACKED +#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100) +# define ECORE_IPC_STRUCT_PACKED __attribute__((packed)) +#else +# define ECORE_IPC_STRUCT_PACKED +#endif + #ifdef __sgi #pragma pack 4 #endif @@ -59,11 +60,7 @@ struct _Ecore_Ipc_Msg_Head int ref_to; int response; int size; -} -#ifdef _GNU_C_ -__attribute__ ((packed)); -#endif -; +} ECORE_IPC_STRUCT_PACKED; #ifdef __sgi #pragma pack 0 #endif -- 2.7.4