Jed Brown  committed c2b829f

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 365c50e
  • Branches jed/ksp-plugin

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);