Skip to content
Snippets Groups Projects
Commit 7dc316a5 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Tristan Matthews
Browse files

contrib: add ucommon rules and patches

Change-Id: I8e819a1172e252e74502a6cb342d4aa5b73fb66d
Refs: #46617
parent 0574e4a6
No related branches found
No related tags found
No related merge requests found
b12fdf19676e2e58c256797f465cd2aa40d8ebb1e9d75e3990ac938adc9771ae31edc40788e7f0b0b69c8c89ff7eb9489ffc889effef06b1d521cb8483bd920f ucommon-6.1.8.tar.gz
--- a/inc/ucommon/platform.h.orig 2014-07-03 16:24:54.711292341 -0400
+++ b/inc/ucommon/platform.h 2014-07-03 16:25:04.847292736 -0400
@@ -86,9 +86,7 @@
// see if we are building for or using extended stdc++ runtime library support
-#if defined(__ANDROID__) || defined(NEW_STDCPP) || defined(OLD_STDCPP)
#define _UCOMMON_EXTENDED_
-#endif
// see if targeting legacy Microsoft windows platform
# UCOMMON
UCOMMON_VERSION := 6.1.8
UCOMMON_URL := https://github.com/dyfet/ucommon/archive/v$(UCOMMON_VERSION).tar.gz
UCOMMON_OPTIONS := --enable-stdcpp --with-pkg-config
ifeq ($(call need_pkg,'ucommon >= 6.0.0 commoncpp >= 6.0.0'),)
PKGS_FOUND += ucommon
endif
DEPS_ucommon = gnutls
$(TARBALLS)/ucommon-$(UCOMMON_VERSION).tar.gz:
$(call download,$(UCOMMON_URL))
.sum-ucommon: ucommon-$(UCOMMON_VERSION).tar.gz
ucommon: ucommon-$(UCOMMON_VERSION).tar.gz .sum-ucommon
$(UNPACK)
$(APPLY) $(SRC)/ucommon/extended.patch
$(APPLY) $(SRC)/ucommon/usedefines.patch
$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && env NOCONFIGURE=1 sh autogen.sh
$(MOVE)
.ucommon: ucommon
cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(UCOMMON_OPTIONS)
cd $< && $(MAKE) install
touch $@
https://github.com/dyfet/ucommon/issues/20
--- a/inc/commoncpp/config.h.orig 2014-06-25 19:15:06.000000000 -0400
+++ b/inc/commoncpp/config.h 2014-06-25 19:15:21.000000000 -0400
@@ -86,8 +86,9 @@
* @param string2 to compare.
* @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1.
*/
-extern "C" inline int stricmp(const char *string1, const char *string2)
- {return ucommon::String::case_compare(string1, string2);}
+#ifndef stricmp
+#define stricmp(x,y) String::case_compare(x,y)
+#endif
/**
* Convenience function for case insensitive null terminated string compare.
@@ -96,8 +97,9 @@
* @param max size of string to compare.
* @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1.
*/
-extern "C" inline int strnicmp(const char *string1, const char *string2, size_t max)
- {return ucommon::String::case_compare(string1, string2, max);}
+#ifndef strnicmp
+#define strnicmp(x,y,z) String::case_compare(x,y,z)
+#endif
#endif
--- a/inc/ucommon/string.h.orig 2014-06-25 19:16:20.000000000 -0400
+++ b/inc/ucommon/string.h 2014-06-25 19:16:27.000000000 -0400
@@ -1627,8 +1627,9 @@
* @param string2 to compare.
* @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1.
*/
-extern "C" inline int stricmp(const char *string1, const char *string2)
- {return String::case_compare(string1, string2);}
+#ifndef stricmp
+#define stricmp(x,y) String::case_compare(x,y)
+#endif
/**
* Convenience function for case insensitive null terminated string compare.
@@ -1637,8 +1638,9 @@
* @param max size of string to compare.
* @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1.
*/
-extern "C" inline int strnicmp(const char *string1, const char *string2, size_t max)
- {return String::case_compare(string1, string2, max);}
+#ifndef strnicmp
+#define strnicmp(x,y,z) String::case_compare(x,y,z)
+#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment