[Info-vax] C... the only winning move is not to play...
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Mon Feb 10 07:11:06 EST 2014
In article <lda30v$gi5$1 at speranza.aioe.org>, hb <end.of at inter.net> writes:
>On 02/10/2014 12:17 AM, VAXman- @SendSpamHere.ORG wrote:
>> 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.
>>
>
>What's the problem? Something like ...
>$ cre x.h
>int foo (int,int);
>[ Exit ]
>$ cre x.c
>#include "x.h"
>int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
>[ Exit ]
>$ cc x
>
>int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
>.........................^
>%CC-E-TOOMANYARGS, In this statement, "foo" expects 2 arguments, but 3
>are supplied.
>at line number 2 in file DISK$USER:[USER]x.c;1
>
>int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
>....................................^
>%CC-E-TOOMANYARGS, In this statement, "foo" expects 2 arguments, but 4
>are supplied.
>at line number 2 in file DISK$USER:[USER]x.c;1
>$
>
>You can just #define the function to something totally different, #undef
>it later and add the correct prototype, like
>
># define foo(x,y) unusedAndUseless
>#include "x.h"
># undef foo
>int foo (int,int,...);
>int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
>
>$ cc x
>$
>
OK. The function is STR$CONCAT.
somewhere VMS pre-V8.*, where it's WRONG, WRONG, WRONG...
#define str$concat STR$CONCAT
#ifdef __NEW_STARLET
unsigned int str$concat(
void *destination_string,
void *source_string);
and later VMS versions, where it's workable,...
#define str$concat STR$CONCAT
#ifdef __NEW_STARLET
unsigned int str$concat(
void *destination_string,
void *source_string_1,
__optional_params);
Now, if you can include <str$routines.h> and make this go away, I'm wanting.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
Well I speak to machines with the voice of humanity.
More information about the Info-vax
mailing list