summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-09-28 15:26:51 +0100
committerTom Hacohen <tom@stosb.com>2015-09-28 15:26:51 +0100
commit35a482141d2fb3c64aa72ef57a432387915ab653 (patch)
tree0a4203b569e03a03e0f546f24e3889463896b893 /src
parent12c39868665e8d327fff27d34a0ba78dadac0961 (diff)
Eo: Clean up windows code.
We were keeping a struct member that wasn't really needed on windows. Since we already broke ABI, we can afford to clean this up.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/Eo.h13
-rw-r--r--src/lib/eo/eo.c10
2 files changed, 7 insertions, 16 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 0746bdff9f..e3c5f1c189 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -342,10 +342,7 @@ typedef enum _Eo_Class_Type Eo_Class_Type;
342 342
343typedef struct _Eo_Op_Description 343typedef struct _Eo_Op_Description
344{ 344{
345 void *api_func; /**< The EAPI function offering this op. */ 345 void *api_func; /**< The EAPI function offering this op. (The name of the func on windows) */
346#ifdef _WIN32
347 const char *api_name; /**< Full name of this API entry-point. Used to work around import indirection in DLL's. */
348#endif
349 void *func; /**< The static function to call for the op. */ 346 void *func; /**< The static function to call for the op. */
350 Eo_Op op; /**< The op. */ 347 Eo_Op op; /**< The op. */
351 Eo_Op_Type op_type; /**< The type of the Op. */ 348 Eo_Op_Type op_type; /**< The type of the Op. */
@@ -463,10 +460,10 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
463 if (Hook) \ 460 if (Hook) \
464 Hook(___call.klass, ___call.obj, FuncName, ___call.func, __VA_ARGS__); 461 Hook(___call.klass, ___call.obj, FuncName, ___call.func, __VA_ARGS__);
465 462
466#ifdef _WIN32 463#ifndef _WIN32
467#define EO_FUNC_COMMON_OP_FUNC(Name) ((const void *) #Name) 464# define EO_FUNC_COMMON_OP_FUNC(Name) ((const void *) Name)
468#else 465#else
469#define EO_FUNC_COMMON_OP_FUNC(Name) ((const void *) Name) 466# define EO_FUNC_COMMON_OP_FUNC(Name) ((const void *) #Name)
470#endif 467#endif
471 468
472// cache OP id, get real fct and object data then do the call 469// cache OP id, get real fct and object data then do the call
@@ -534,7 +531,7 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
534#ifndef _WIN32 531#ifndef _WIN32
535# define _EO_OP_API_ENTRY(a) a 532# define _EO_OP_API_ENTRY(a) a
536#else 533#else
537# define _EO_OP_API_ENTRY(a) a, #a 534# define _EO_OP_API_ENTRY(a) #a
538#endif 535#endif
539 536
540#define EO_OP_FUNC(_api, _private) { _EO_OP_API_ENTRY(_api), _private, EO_NOOP, EO_OP_TYPE_REGULAR } 537#define EO_OP_FUNC(_api, _private) { _EO_OP_API_ENTRY(_api), _private, EO_NOOP, EO_OP_TYPE_REGULAR }
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index d70320849e..da38fdcf02 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -739,7 +739,6 @@ _eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class *
739 return op_desc; 739 return op_desc;
740 } 740 }
741#else 741#else
742 const char *api_name = api_func; /* We put it here on windows. */
743 /* On Windows, DLL API's will be exported using the dllexport flag. 742 /* On Windows, DLL API's will be exported using the dllexport flag.
744 * When used by another library or executable, they will be declared 743 * When used by another library or executable, they will be declared
745 * using the dllimport flag. What happens really is that two symbols are 744 * using the dllimport flag. What happens really is that two symbols are
@@ -749,10 +748,9 @@ _eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class *
749 */ 748 */
750 for (unsigned int i = 0; i < cur_klass->desc->ops.count; i++) 749 for (unsigned int i = 0; i < cur_klass->desc->ops.count; i++)
751 { 750 {
752 if (api_name && !strcmp(api_name, op_descs[i].api_name)) 751 if (((op_descs[i].api_func != NULL) && (op_descs[i].api_func != ((void (*)())-1))) &&
752 (api_func && !strcmp(api_func, op_descs[i].api_func)))
753 { 753 {
754 if (op_descs[i].api_func == NULL || op_descs[i].api_func == ((void (*)())-1))
755 break;
756 return &op_descs[i]; 754 return &op_descs[i];
757 } 755 }
758 } 756 }
@@ -856,11 +854,7 @@ _eo_class_funcs_set(_Eo_Class *klass)
856 } 854 }
857 else if (op_desc->op == EO_OP_OVERRIDE) 855 else if (op_desc->op == EO_OP_OVERRIDE)
858 { 856 {
859#ifdef _WIN32
860 api_desc = _eo_api_desc_get(op_desc->api_name, klass->parent, klass->extensions);
861#else
862 api_desc = _eo_api_desc_get(op_desc->api_func, klass->parent, klass->extensions); 857 api_desc = _eo_api_desc_get(op_desc->api_func, klass->parent, klass->extensions);
863#endif
864 858
865 if (api_desc == NULL) 859 if (api_desc == NULL)
866 { 860 {