[Info-vax] C... the only winning move is not to play...
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Sun Feb 9 19:15:10 EST 2014
On 2014-02-09 23:17:04 +0000, VAXman- @SendSpamHere.ORG said:
> I've encountered a VMS library call prototype that is incorrect. How
> can I override/overwrite the prototype in my source to make it correct?
> I've used other routines from this library without issue save for this
> one. Is there a #pragma that allows for or provides this? I've read
> the on-line help but don't see anything under #pragma.
I'm assuming this is a VMS header for the system or for an RTL, and
probably something that was generated via SDL.
Hack it. Extract the header file, fix it, and either insert it back
under the same name, insert under a different name and #include
<foodef-other.h>, or pull it in via a #include "mylocalcopy.h" syntax.
This where the file was either edited directly, or maybe regenerated
via SDL processing on the SDI file from STARLETSD.TLB.
You could probably also do a symbol name fix-up via a patch or using
some linker arcana, but that's more work than its worth.
If you wanted to be slightly sneaky (and depending on the particular
call and the OpenVMS version), declare your replacement as a function
pointer under a different name and use a call to lib$find_image_symbol
to find the virtual address of the "real" function, and jump to that.
No, VMS C doesn't have anything akin to --wrap or related baggage
<http://wwwold.cs.umd.edu/Library/TRs/CS-TR-4585/CS-TR-4585.pdf>, and
the closest analog to the preloading (the lib$initialize psect)
wouldn't seem to get you closer to your goal.
Document the shenanigans locally for the code, and dispatch a bug
report along to HP so that you can record the bug report number in the
comments.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list