summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-09-30 08:37:31 +0100
committerTom Hacohen <tom@stosb.com>2015-09-30 08:38:47 +0100
commit001aa98942f0dc17c1ca81d9d23a8c54fd77e2b2 (patch)
tree7105c01bd3ebc15c5dc21ece3ee1e4b072ecb70a /src
parent844fde5a8735221a170b9fb7dedd86043b3782b9 (diff)
Eo: Clean up windows code a bit more.
Merge more parts of it with the non-windows code.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/eo.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 7e9b0a5633..95cb37ee2c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -695,31 +695,27 @@ _eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class *
695 cur_klass = *kls_itr; 695 cur_klass = *kls_itr;
696 op_descs = cur_klass->desc->ops.descs; 696 op_descs = cur_klass->desc->ops.descs;
697 697
698#ifndef _WIN32
699 for (i = 0, op_desc = op_descs; i < cur_klass->desc->ops.count; i++, op_desc++) 698 for (i = 0, op_desc = op_descs; i < cur_klass->desc->ops.count; i++, op_desc++)
700 { 699 {
700#ifndef _WIN32
701 if (op_desc->api_func == api_func) 701 if (op_desc->api_func == api_func)
702 { 702 {
703 return op_desc; 703 return op_desc;
704 } 704 }
705 }
706#else 705#else
707 /* On Windows, DLL API's will be exported using the dllexport flag. 706 /* On Windows, DLL API's will be exported using the dllexport flag.
708 * When used by another library or executable, they will be declared 707 * When used by another library or executable, they will be declared
709 * using the dllimport flag. What happens really is that two symbols are 708 * using the dllimport flag. What happens really is that two symbols are
710 * created, at two different addresses. So it's impossible to match 709 * created, at two different addresses. So it's impossible to match
711 * them. We fallback to plain string comparison based on the 710 * them. We fallback to plain string comparison based on the
712 * function name itself. Slow, but this should rarely happen. 711 * function name itself. Slow, but this should rarely happen.
713 */ 712 */
714 for (i = 0; i < cur_klass->desc->ops.count; i++) 713 if (api_func && op_desc->api_func && !strcmp(api_func, op_desc->api_func))
715 {
716 if (((op_descs[i].api_func != NULL) && (op_descs[i].api_func != ((void (*)())-1))) &&
717 (api_func && !strcmp(api_func, op_descs[i].api_func)))
718 { 714 {
719 return &op_descs[i]; 715 return op_desc;
720 } 716 }
721 }
722#endif 717#endif
718 }
723 } 719 }
724 } 720 }
725 721