- Add SWIG_RUNTIME_VERSION to new type sharing code. This is for future-proof, if

the format of swig_type_info ever changes, this number should be incremented
- Add SWIG_LINK_RUNTIME and SWIG_STATIC_RUNTIME symbols to python
- Convert inline into SWIGINLINE


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6475 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2004-10-21 21:53:54 +00:00
commit 0c57969c61
14 changed files with 140 additions and 41 deletions

View file

@ -592,6 +592,7 @@ SWIGEXPORT(void) SWIG_init(int, C_word, C_word) C_noret;
%insert(init) %{
/* CHICKEN initialization function */
static char[] swig_type_ptr_name = "type_pointer" SWIG_TYPE_TABLE_NAME;
SWIGEXPORT(void)
SWIG_init(int argc, C_word closure, C_word continuation) {
static int typeinit = 0;
@ -603,15 +604,15 @@ SWIG_init(int argc, C_word closure, C_word continuation) {
if (!typeinit) {
/* lookup the type pointer... it is stored in it's own symbol table */
C_SYMBOL_TABLE *stable = C_find_symbol_table("swig_runtime_data");
C_SYMBOL_TABLE *stable = C_find_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION);
if (stable != NULL) {
sym = SWIG_Chicken_LookupSymbol("type_pointer", stable);
sym = SWIG_Chicken_LookupSymbol(swig_type_ptr_name, stable);
if (C_truep(sym) && C_swig_is_ptr(sym)) {
swig_type_list_handle = (swig_type_info **) C_block_item(sym, 0);
}
} else {
stable = C_new_symbol_table("swig_runtime_data", 16);
sym = C_intern_in(C_heaptop, C_strlen("type_pointer"), "type_pointer", stable);
stable = C_new_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION, 16);
sym = C_intern_in(C_heaptop, C_strlen(swig_type_ptr_name), swig_type_ptr_name, stable);
C_mutate(&C_block_item(sym, 0), C_mpointer(C_heaptop, (void *) swig_type_list_handle));
}

View file

@ -161,7 +161,7 @@ SWIG_Chicken_Barf(int code, C_char *msg, ...)
}
}
static inline C_word
static SWIGINLINE C_word
SWIG_Chicken_NewPointerObj(void *ptr, swig_type_info *type, int owner, C_word **data)
{
if (ptr == NULL)
@ -199,7 +199,7 @@ SWIG_Chicken_ConvertPtr(C_word s, void **result, swig_type_info *type, int flags
return 1;
}
static inline void *
static SWIGINLINE void *
SWIG_Chicken_MustGetPtr (C_word s, swig_type_info *type, int argnum, int flags)
{
void *result;