[glom] Hide __libc_freeres on system which don't have glibc.
- From: Jasper Lievisse Adriaanse <jasperla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Hide __libc_freeres on system which don't have glibc.
- Date: Thu, 29 Sep 2011 20:56:10 +0000 (UTC)
commit bf111b2f3d39fa8aa27a6b3e6778ae8f987cad8f
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date: Thu Sep 29 22:54:56 2011 +0200
Hide __libc_freeres on system which don't have glibc.
https://bugzilla.gnome.org/show_bug.cgi?id=660496
ChangeLog | 8 ++++++++
glom/main.cc | 6 ++++--
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 01f0885..c822a36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-29 Jasper Lievisse Adriaanse <jasperla gnome org>
+
+ Remove glibc-specific function call.
+
+ * glom/main.cc: Fix build on OpenBSD (and other non-glibc systems)
+ by wrapping calls to __libc_freeres() in correct #ifdefs.
+ Bug #660496
+
2011-09-29 Murray Cumming <murrayc murrayc com>
Print Layout: Add experimental Create Standard feature.
diff --git a/glom/main.cc b/glom/main.cc
index 237c6b9..a356193 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -373,18 +373,19 @@ bool check_pygda_is_available_with_warning()
} //namespace Glom
-#ifndef G_OS_WIN32
+#ifdef __linux__
extern "C" void __libc_freeres(void);
#endif
int
main(int argc, char* argv[])
{
-#ifndef G_OS_WIN32
+#ifdef __linux__
//Force some cleanup at exit,
//to help valgrind to detect memory leaks:
atexit(__libc_freeres);
#else
+# ifdef G_OS_WIN32
WSADATA data;
int errcode = WSAStartup(MAKEWORD(2, 0), &data);
if(errcode != 0)
@@ -396,6 +397,7 @@ main(int argc, char* argv[])
gchar* installation_dir_c = g_win32_get_package_installation_directory_of_module(0);
const std::string installation_dir(installation_dir_c);
g_free(installation_dir_c);
+# endif
#endif
// TODO: I am not sure why, but this does not work. PYTHONPATH is set
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]