Change in libosmocore[master]: Streamline glibc version check

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Sun Nov 11 21:44:45 UTC 2018


Max has uploaded this change for review. ( https://gerrit.osmocom.org/11719


Change subject: Streamline glibc version check
......................................................................

Streamline glibc version check

* use macro for version check
* report glibc version upon detection

Change-Id: Ia54f0b7a861f955be65bb0cf06eb10af9372d062
---
M src/gsm/gsm_utils.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/11719/1

diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 7e6c794..be35cd4 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -95,11 +95,12 @@
 #include <inttypes.h>
 #include <time.h>
 #include <unistd.h>
+#include <features.h>
 
 #include "../../config.h"
 
-/* FIXME: this can be removed once we bump glibc requirements to 2.25: */
-#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25)
+/* FIXME: this can be removed once we bump glibc requirements to 2.25:*/
+#if __GNUC_PREREQ (2,25)
 #include <sys/random.h>
 #elif HAVE_DECL_SYS_GETRANDOM
 #include <sys/syscall.h>
@@ -131,6 +132,8 @@
 	if (!gnutls_check_version("3.3.0"))
 		gnutls_global_deinit();
 }
+#else
+#pragma message ("glibc " OSMO_STRINGIFY_VAL(__GLIBC__) "." OSMO_STRINGIFY_VAL(__GLIBC_MINOR__) " random detected")
 #endif
 
 /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet

-- 
To view, visit https://gerrit.osmocom.org/11719
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia54f0b7a861f955be65bb0cf06eb10af9372d062
Gerrit-Change-Number: 11719
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181111/833ce801/attachment.htm>


More information about the gerrit-log mailing list