Jed Brown  committed cf4b33a

DLL: translate hyphens to dashes in basename for initializer

For example, when adding a library using

-dll_append /path/to/

we now look for the initializer PetscDLLibraryRegister_foo_bar().

  • Participants
  • Parent commits d0286d3

Comments (0)

Files changed (1)

File src/sys/dll/dl.c

   else {
     ierr = PetscInfo1(0,"Dynamic library %s does not have lib prefix\n",libname);CHKERRQ(ierr);
+  for (s=basename; *s; s++) if (*s == '-') *s = '_';
   ierr = PetscStrlen(basename,&len);CHKERRQ(ierr);
   ierr = PetscStrcpy(registername,"PetscDLLibraryRegister_");CHKERRQ(ierr);
   ierr = PetscStrncat(registername,basename,len);CHKERRQ(ierr);