What is there to say but, Thank you , Thank you, Thank you, from the
very bottom of my soul !!!.
Lachlan MacColl
>Hi - in the thread "Unresolved references and internal error..." I gave this
>response to the question about the __linkproc__ intover bug in Borland, I
>have also included the comment from Ed Mulroy about the workaround.
>
>^__^
>Mike
>
>----
>My original post:
>---
>
>Hi,
>
>I might have some input to the linkproc _intover_ problem you have seen, I
>can not explain why the compiler sometimes generate this error, but I can
>tell you what happens... And give you a solution that will remove the error
>in the future...
>If you have a function like :
>
>int foo(int a, int b)
>
>{
>
> return a+b;
>
>}
>
>
>
>The Borland compiler will generate code like this:
>
> _foo push ebp
> mov ebp,esp
> mov eax,+8H[ebp]
> add eax,+0cH[ebp]
> pop ebp
> ret
>
>But for some obscure reason sometimes it generate code like this:
>
>_foo push ebp
> mov ebp,esp
> mov eax,+8H[ebp]
> add eax,+0cH[ebp]
> jno L1
> call @@intover
>L1 pop ebp
> ret
>
>as you can see, it suddenly calls the @@intover function in case of an
>overflow - but since this is not a function included in the libraries linked
>when generating the exe file we get the linker error.
>
>The way to make the code link anyway is to declare a @@intover function,
>i.e. by including the following code in an *.asm file an add it to your
>project:
>
>
>--------intover.asm begin-------
>
>; This file contains a dummy define of the intover function used to prevent
>; the linkproc _intover_ linker error in Borland builds
>;
>
>
>.586
>.model large
>EXTERNDEF @@intover: FAR
>.code
>
>@@intover PROC FAR
>db 0c3h
>@@intover ENDP
>
>end
>--------intover.asm end-------
>
>It should be noted that it have been seen that the C++ builder environment
>sometimes refuses to generate an .obj file from the above assembler (even it
>assembles it!!) - if you experience that, just make an empty project with
>nothing but the above file in it, make the file, and include the generated
>.obj file into your main project.
>
>Hope it helps :o)
>
>Regards,
>
>Mike K.
>
>---
>Answer from Ed Mulroy:
>---
>
>Clever workaround. I have not confirmed that it works, but can't as I
>haven't had the intover problem. I think you need to use flat instead of
>large for Win32 apps.
>
>Since not all versions of C++ Builder come with TASM32, not all can use that
>source code. I have posted a file, INTOVER.OBJ, in
>borland.public.attachments for those who wish to use it but don't have
>TASM32. The message name is intover.obj Note that an object file can be
>added to a project list. It was built from this source:
>
>--------------------
>.586
>.model flat
>EXTERNDEF @@intover: FAR
>.code
>
>@@intover PROC FAR
>db 0c3h
>@@intover ENDP
>
>end
>--------------------
>
>. Ed
>
>