Posted to tcl by stevel at Mon Feb 22 02:06:53 GMT 2010view raw

  1. #ifdef WIN32
  2. // if the filesystem holding the dll doesn't support direct loading
  3. // we need to copy it to a temporary directory and load it from there
  4. // - critcl2::precopy is defined in critcl/lib/app-critcl/runtime.tcl
  5.  
  6. if ((fsPtr = Tcl_FSGetFileSystemForPath(objv[1])) != NULL \
  7. && fsPtr->loadFileProc == NULL) {
  8. int len;
  9. Tcl_Obj *dirs;
  10. objv[0] = Tcl_NewStringObj("::critcl2::precopy", -1);
  11. if ((code = Tcl_EvalObjv(interp, 2, objv, 0)) != TCL_OK) {
  12. Tcl_SetErrorCode(interp, "could not preload ",
  13. Tcl_GetString(objv[1]), 0);
  14. return TCL_ERROR;
  15. }
  16. objv[1] = Tcl_GetObjResult(interp);
  17. Tcl_IncrRefCount(objv[1]);
  18. dirs = Tcl_FSSplitPath(objv[1], &len);
  19. preload = (PreloadInfo *) ckalloc(sizeof(PreloadInfo));
  20. preload->dir = Tcl_FSJoinPath(dirs, --len);
  21. Tcl_IncrRefCount(preload->dir);
  22. }
  23. #endif