Eina: Fix compilation with --enable-amalgamation.
Sorry dh :P SVN revision: 50545
This commit is contained in:
parent
6b69189efd
commit
32c7a50118
|
@ -122,6 +122,7 @@ eina_amalgamation.c: $(base_sources) Makefile
|
||||||
@echo "#include \"eina_private.h\"" >> eina_amalgamation.c
|
@echo "#include \"eina_private.h\"" >> eina_amalgamation.c
|
||||||
@echo "#include \"eina_safety_checks.h\"" >> eina_amalgamation.c
|
@echo "#include \"eina_safety_checks.h\"" >> eina_amalgamation.c
|
||||||
@echo "#include \"Eina.h\"" >> eina_amalgamation.c
|
@echo "#include \"Eina.h\"" >> eina_amalgamation.c
|
||||||
|
@echo "#include \"eina_share_common.h\"" >> eina_amalgamation.c
|
||||||
|
|
||||||
@for f in $(base_sources); do \
|
@for f in $(base_sources); do \
|
||||||
if [ `echo $$f | sed -e 's/^...\(.\).*/\1/'` != '/' ]; then \
|
if [ `echo $$f | sed -e 's/^...\(.\).*/\1/'` != '/' ]; then \
|
||||||
|
|
|
@ -120,11 +120,11 @@ eina_binshare_shutdown(void)
|
||||||
* will happen, likely a segmentation fault.
|
* will happen, likely a segmentation fault.
|
||||||
*/
|
*/
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_binshare_del(const char *str, unsigned int slen)
|
eina_binshare_del(const char *str)
|
||||||
{
|
{
|
||||||
if (!str)
|
if (!str)
|
||||||
return;
|
return;
|
||||||
eina_share_common_del(share,(const char *) str, slen);
|
eina_share_common_del(share,(const char *) str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -736,8 +736,9 @@ eina_share_common_ref(Eina_Share *share, const char *str)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
eina_share_common_del(Eina_Share *share, const char *str, int slen)
|
eina_share_common_del(Eina_Share *share, const char *str)
|
||||||
{
|
{
|
||||||
|
unsigned int slen;
|
||||||
Eina_Share_Common_Head *ed;
|
Eina_Share_Common_Head *ed;
|
||||||
Eina_Share_Common_Head **p_bucket;
|
Eina_Share_Common_Head **p_bucket;
|
||||||
Eina_Share_Common_Node *node;
|
Eina_Share_Common_Node *node;
|
||||||
|
@ -745,11 +746,11 @@ eina_share_common_del(Eina_Share *share, const char *str, int slen)
|
||||||
|
|
||||||
if (!str) return;
|
if (!str) return;
|
||||||
|
|
||||||
eina_share_common_population_del(share, slen);
|
|
||||||
|
|
||||||
SHARE_COMMON_LOCK_BIG();
|
SHARE_COMMON_LOCK_BIG();
|
||||||
|
|
||||||
node = _eina_share_common_node_from_str(str, share->node_magic);
|
node = _eina_share_common_node_from_str(str, share->node_magic);
|
||||||
|
slen = node->length;
|
||||||
|
eina_share_common_population_del(share, slen);
|
||||||
if (node->references > 1)
|
if (node->references > 1)
|
||||||
{
|
{
|
||||||
node->references--;
|
node->references--;
|
||||||
|
@ -760,7 +761,6 @@ eina_share_common_del(Eina_Share *share, const char *str, int slen)
|
||||||
|
|
||||||
DBG("str=%p refs=0, delete.", str);
|
DBG("str=%p refs=0, delete.", str);
|
||||||
node->references = 0;
|
node->references = 0;
|
||||||
slen = node->length;
|
|
||||||
|
|
||||||
hash = eina_hash_superfast(str, slen);
|
hash = eina_hash_superfast(str, slen);
|
||||||
hash_num = hash & 0xFF;
|
hash_num = hash & 0xFF;
|
||||||
|
|
|
@ -65,7 +65,7 @@ Eina_Bool eina_share_common_init(Eina_Share **share, Eina_Magic node_magic, cons
|
||||||
Eina_Bool eina_share_common_shutdown(Eina_Share **share);
|
Eina_Bool eina_share_common_shutdown(Eina_Share **share);
|
||||||
const char *eina_share_common_add_length(Eina_Share *share, const char *str, unsigned int slen, unsigned int null_size) EINA_WARN_UNUSED_RESULT;
|
const char *eina_share_common_add_length(Eina_Share *share, const char *str, unsigned int slen, unsigned int null_size) EINA_WARN_UNUSED_RESULT;
|
||||||
const char *eina_share_common_ref(Eina_Share *share, const char *str);
|
const char *eina_share_common_ref(Eina_Share *share, const char *str);
|
||||||
void eina_share_common_del(Eina_Share *share, const char *str, int slen);
|
void eina_share_common_del(Eina_Share *share, const char *str);
|
||||||
int eina_share_common_length(Eina_Share *share, const char *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
|
int eina_share_common_length(Eina_Share *share, const char *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
|
||||||
void eina_share_common_dump(Eina_Share *share, void (* additional_dump)(struct dumpinfo *), int used);
|
void eina_share_common_dump(Eina_Share *share, void (* additional_dump)(struct dumpinfo *), int used);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,36 @@
|
||||||
|
#ifdef _STRBUF_DATA_TYPE
|
||||||
|
# undef _STRBUF_DATA_TYPE
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_CSIZE
|
||||||
|
# undef _STRBUF_CSIZE
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRUCT_NAME
|
||||||
|
# undef _STRBUF_STRUCT_NAME
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRLEN_FUNC
|
||||||
|
# undef _STRBUF_STRLEN_FUNC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRESCAPE_FUNC
|
||||||
|
# undef _STRBUF_STRESCAPE_FUNC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC
|
||||||
|
# undef _STRBUF_MAGIC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC_STR
|
||||||
|
# undef _STRBUF_MAGIC_STR
|
||||||
|
#endif
|
||||||
|
#ifdef _FUNC_EXPAND
|
||||||
|
# undef _FUNC_EXPAND
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _STRBUF_DATA_TYPE char
|
#define _STRBUF_DATA_TYPE char
|
||||||
#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
|
#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
|
||||||
#define _STRBUF_STRUCT_NAME Eina_Strbuf
|
#define _STRBUF_STRUCT_NAME Eina_Strbuf
|
||||||
#define _STRBUF_STRLEN_FUNC(x) strlen(x)
|
#define _STRBUF_STRLEN_FUNC(x) strlen(x)
|
||||||
#define _STRBUF_STRESCAPE_FUNC(x) eina_str_escape(x)
|
#define _STRBUF_STRESCAPE_FUNC(x) eina_str_escape(x)
|
||||||
#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
|
#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
|
||||||
static const char _STRBUF_MAGIC_STR[] = "Eina Strbuf";
|
#define _STRBUF_MAGIC_STR __STRBUF_MAGIC_STR
|
||||||
|
static const char __STRBUF_MAGIC_STR[] = "Eina Strbuf";
|
||||||
|
|
||||||
#define _FUNC_EXPAND(y) eina_strbuf_##y
|
#define _FUNC_EXPAND(y) eina_strbuf_##y
|
||||||
|
|
||||||
|
|
|
@ -638,9 +638,21 @@ eina_strbuf_common_length_get(const Eina_Strbuf *buf)
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/*FIXME: Implementing them here is a hack! */
|
/*FIXME: Implementing them here is a hack! */
|
||||||
|
|
||||||
|
#ifdef _STRBUF_CSIZE
|
||||||
|
# undef _STRBUF_CSIZE
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC
|
||||||
|
# undef _STRBUF_MAGIC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC_STR
|
||||||
|
# undef _STRBUF_MAGIC_STR
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _STRBUF_CSIZE 1
|
#define _STRBUF_CSIZE 1
|
||||||
#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
|
#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
|
||||||
static const char _STRBUF_MAGIC_STR[] = "Eina Strbuf";
|
#define _STRBUF_MAGIC_STR __STRBUF_STR_MAGIC_STR
|
||||||
|
static const char __STRBUF_STR_MAGIC_STR[] = "Eina Strbuf";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ brief Replace the n-th string with an other string.
|
* @ brief Replace the n-th string with an other string.
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
* a lot easier since those are essentially the same just with different sizes.
|
* a lot easier since those are essentially the same just with different sizes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EINA_STRBUF_TEMPLATE_C_I
|
|
||||||
#define EINA_STRBUF_TEMPLATE_C_I
|
|
||||||
|
|
||||||
|
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
#include "eina_strbuf_common.h"
|
#include "eina_strbuf_common.h"
|
||||||
#include "eina_unicode.h"
|
#include "eina_unicode.h"
|
||||||
|
@ -217,8 +213,3 @@ _FUNC_EXPAND(length_get)(const _STRBUF_STRUCT_NAME *buf)
|
||||||
EINA_MAGIC_CHECK_STRBUF(buf, 0);
|
EINA_MAGIC_CHECK_STRBUF(buf, 0);
|
||||||
return eina_strbuf_common_length_get(buf);
|
return eina_strbuf_common_length_get(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
#error Something went terribly wrong, shouldnt be included twice!
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -578,9 +578,7 @@ eina_stringshare_del(const char *str)
|
||||||
STRINGSHARE_UNLOCK_SMALL();
|
STRINGSHARE_UNLOCK_SMALL();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
slen = strlen(str);
|
eina_share_common_del(share, str);
|
||||||
slen = (int) (slen * sizeof(char));
|
|
||||||
eina_share_common_del(share, str, slen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,13 +2,40 @@
|
||||||
#include "eina_unicode.h"
|
#include "eina_unicode.h"
|
||||||
#include "eina_ustrbuf.h"
|
#include "eina_ustrbuf.h"
|
||||||
|
|
||||||
|
#ifdef _STRBUF_DATA_TYPE
|
||||||
|
# undef _STRBUF_DATA_TYPE
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_CSIZE
|
||||||
|
# undef _STRBUF_CSIZE
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRUCT_NAME
|
||||||
|
# undef _STRBUF_STRUCT_NAME
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRLEN_FUNC
|
||||||
|
# undef _STRBUF_STRLEN_FUNC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_STRESCAPE_FUNC
|
||||||
|
# undef _STRBUF_STRESCAPE_FUNC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC
|
||||||
|
# undef _STRBUF_MAGIC
|
||||||
|
#endif
|
||||||
|
#ifdef _STRBUF_MAGIC_STR
|
||||||
|
# undef _STRBUF_MAGIC_STR
|
||||||
|
#endif
|
||||||
|
#ifdef _FUNC_EXPAND
|
||||||
|
# undef _FUNC_EXPAND
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define _STRBUF_DATA_TYPE Eina_Unicode
|
#define _STRBUF_DATA_TYPE Eina_Unicode
|
||||||
#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
|
#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
|
||||||
#define _STRBUF_STRUCT_NAME Eina_UStrbuf
|
#define _STRBUF_STRUCT_NAME Eina_UStrbuf
|
||||||
#define _STRBUF_STRLEN_FUNC(x) eina_unicode_strlen(x)
|
#define _STRBUF_STRLEN_FUNC(x) eina_unicode_strlen(x)
|
||||||
#define _STRBUF_STRESCAPE_FUNC(x) eina_unicode_escape(x)
|
#define _STRBUF_STRESCAPE_FUNC(x) eina_unicode_escape(x)
|
||||||
#define _STRBUF_MAGIC EINA_MAGIC_USTRBUF
|
#define _STRBUF_MAGIC EINA_MAGIC_USTRBUF
|
||||||
static const char _STRBUF_MAGIC_STR[] = "Eina UStrbuf";
|
#define _STRBUF_MAGIC_STR __USTRBUF_MAGIC_STR
|
||||||
|
static const char __USTRBUF_MAGIC_STR[] = "Eina UStrbuf";
|
||||||
|
|
||||||
#define _FUNC_EXPAND(y) eina_ustrbuf_##y
|
#define _FUNC_EXPAND(y) eina_ustrbuf_##y
|
||||||
|
|
||||||
|
|
|
@ -121,12 +121,9 @@ eina_ustringshare_shutdown(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_ustringshare_del(const Eina_Unicode *str)
|
eina_ustringshare_del(const Eina_Unicode *str)
|
||||||
{
|
{
|
||||||
int slen;
|
|
||||||
if (!str)
|
if (!str)
|
||||||
return;
|
return;
|
||||||
slen = eina_unicode_strlen(str);
|
eina_share_common_del(share,(const char *) str);
|
||||||
slen = (int) (slen * sizeof(Eina_Unicode));
|
|
||||||
eina_share_common_del(share,(const char *) str, slen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue