cvsuser     04/05/26 05:19:27

  Modified:    runtime/parrot/library parrotlib.imc
               src      dynext.c
  Log:
  fixed dynext locating
  PARROT_DLL_EXTENSION is now passed to the bytecode function as an additional 
parameter
  
  Revision  Changes    Path
  1.4       +7 -11     parrot/runtime/parrot/library/parrotlib.imc
  
  Index: parrotlib.imc
  ===================================================================
  RCS file: /cvs/public/parrot/runtime/parrot/library/parrotlib.imc,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- parrotlib.imc     25 May 2004 13:46:36 -0000      1.3
  +++ parrotlib.imc     26 May 2004 12:19:23 -0000      1.4
  @@ -62,7 +62,7 @@
       # setup the signatures
       set_signature( "include_file_location", "SS" )
       set_signature( "bytecode_location", "SS" )
  -    set_signature( "dynext_location", "SS" )
  +    set_signature( "dynext_location", "SSSP" )
   .end
   
   =item STRING = include_file_location( STRING )
  @@ -113,11 +113,8 @@
   
   .sub dynext_location
       .param string request
  +    .param string ext
       .local string name
  -    .local string ext
  -    
  -    # XXX: how can I get "PARROT_DLL_EXTENSION"?
  -    ext = ".so"
           
       name = request
       stat $I0, name, 0
  @@ -139,10 +136,9 @@
       stat $I0, name, 0
       if $I0 goto END
   
  -    print "Couldn't load '"
  -    print request
  -    print "'\n"
  -    null name
  +    # file not found, give the OS a chance to locate it
  +    name = clone request
  +    concat name, ext
       
   END:
       .pcc_begin_return
  
  
  
  1.25      +9 -11     parrot/src/dynext.c
  
  Index: dynext.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/dynext.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -r1.24 -r1.25
  --- dynext.c  25 May 2004 17:56:25 -0000      1.24
  +++ dynext.c  26 May 2004 12:19:27 -0000      1.25
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: dynext.c,v 1.24 2004/05/25 17:56:25 jrieks Exp $
  +$Id: dynext.c,v 1.25 2004/05/26 12:19:27 jrieks Exp $
   
   =head1 NAME
   
  @@ -224,26 +224,24 @@
       char *cinit_func_name, *cload_func_name;
       PMC *lib_pmc;
   
  -    UNUSED(initializer);
   #if defined(_PARROTLIB)
  -    path = Parrot_library_query(interpreter, "dynext_location", lib, initializer);
  +    type = const_string(interpreter, PARROT_DLL_EXTENSION);
  +    path = Parrot_library_query(interpreter, "dynext_location", lib, type, 
initializer);
  +    if (path) {
  +     char* cpath = string_to_cstring(interpreter, path);
  +     handle = Parrot_dlopen(cpath);
  +    }
   #else
  +    UNUSED(initializer);
       path = get_path(interpreter, lib, &handle);
   #endif
  -    if (!path) {
  +    if (!path || !handle) {
           /*
            * XXX internal_exception? return a PerlUndef?
            */
           return PMCNULL;
       }
   
  -#if defined(_PARROTLIB)
  -    {
  -     char* cpath = string_to_cstring(interpreter, path);
  -     handle = Parrot_dlopen(cpath);
  -    }
  -#endif
  -
       /*
        * TODO move the class_count_mutex here
        *
  
  
  

Reply via email to