]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
internal: don't use weak symbols for Win32 platform
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Jul 2017 14:24:06 +0000 (15:24 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Jul 2017 14:26:54 +0000 (15:26 +0100)
The Win32 platform will fail to link if you use weak symbols
because it is incompatible with exporting symbols in a DLL:

Cannot export virRandomGenerateWWN: symbol wrong type (2 vs 3)

We only need weak symbols for our test suite to do LD_PRELOAD
and this doesn't work on Win32, so we can just drop the hack
for Win32

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/internal.h

index 00edd4fdeb1f399908cf521b463d2ae6561fc833..edc3587959a9f15ca81a1679e410149506b50351 100644 (file)
  *
  */
 # ifndef ATTRIBUTE_MOCKABLE
-#  if __GNUC_PREREQ(4, 5)
-#   define ATTRIBUTE_MOCKABLE __attribute__((__noinline__, __noclone__, __weak__))
+#  if defined(WIN32)
+#   define ATTRIBUTE_MOCKABLE
 #  else
-#   define ATTRIBUTE_MOCKABLE __attribute__((__noinline__, __weak__))
+#   if __GNUC_PREREQ(4, 5)
+#    define ATTRIBUTE_MOCKABLE __attribute__((__noinline__, __noclone__, __weak__))
+#   else
+#    define ATTRIBUTE_MOCKABLE __attribute__((__noinline__, __weak__))
+#   endif
 #  endif
 # endif