diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-02-05 09:21:13 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-02-05 09:21:13 (GMT) |
commit | 1226e764ba9a04dca4126134e7c596ab65dac9fe (patch) | |
tree | afc213456820eba92e993ff636a7447d3a9b8da2 /generic/tclLoadNone.c | |
parent | bfab34ad8b713918717cdfba00e87e331f9e5cea (diff) | |
parent | 7da7ccee61524b7d2392c3bd8b5cb11a448acf88 (diff) | |
download | tcl-1226e764ba9a04dca4126134e7c596ab65dac9fe.zip tcl-1226e764ba9a04dca4126134e7c596ab65dac9fe.tar.gz tcl-1226e764ba9a04dca4126134e7c596ab65dac9fe.tar.bz2 |
[3433012]: Added dummy version of TclpLoadMemory to use in the event that a
platform thinks it can load from memory but cannot actually do so due to it
being disabled at configuration time.
Diffstat (limited to 'generic/tclLoadNone.c')
-rw-r--r-- | generic/tclLoadNone.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c index f030d89..5a2dc53 100644 --- a/generic/tclLoadNone.c +++ b/generic/tclLoadNone.c @@ -82,6 +82,39 @@ TclGuessPackageName( } /* + * These functions are fallbacks if we somehow determine that the platform can + * do loading from memory but the user wishes to disable it. They just report + * (gracefully) that they fail. + */ + +#ifdef TCL_LOAD_FROM_MEMORY + +MODULE_SCOPE void * +TclpLoadMemoryGetBuffer( + Tcl_Interp *interp, /* Dummy: unused by this implementation */ + int size) /* Dummy: unused by this implementation */ +{ + return NULL; +} + +MODULE_SCOPE int +TclpLoadMemory( + Tcl_Interp *interp, /* Used for error reporting. */ + void *buffer, /* Dummy: unused by this implementation */ + int size, /* Dummy: unused by this implementation */ + int codeSize, /* Dummy: unused by this implementation */ + Tcl_LoadHandle *loadHandle, /* Dummy: unused by this implementation */ + Tcl_FSUnloadFileProc **unloadProcPtr) + /* Dummy: unused by this implementation */ +{ + Tcl_SetResult(interp, "dynamic loading from memory is not available " + "on this system", TCL_STATIC); + return TCL_ERROR; +} + +#endif /* TCL_LOAD_FROM_MEMORY */ + +/* * Local Variables: * mode: c * c-basic-offset: 4 |