An interesting idea Manoj, and something that I think would ultimately work if we intended to treat the functions from the library as stand-alone calls. Unfortunately we're not, my goal was to change a single function from a series that were called in the library that was already compiled (so the preprocessor definition would have already happened).
I appreciate the suggestions you and Paul Herring provided, but I'm suffering from trying to impose some object oriented design concepts onto a language and (more importantly) a code base that weren't designed for it. Had we thought ahead or if I could justify a major rewrite of the code, we could make it work like I want it to, but that's not the case.
Thank you,
Tom
On 8/8/06, blaunche <[EMAIL PROTECTED]> wrote:
I believe you can override the function by using preprocessors.
If u want to override fun(),
you just #define fun fun_local
.Then try to call fun from your local function ..It invoke
fun_local and ultimately library function got overriden.
Expecting feed back........
Thanks
Manoj
--- In [email protected], "Thomas Voth" <[EMAIL PROTECTED]> wrote:
>
> Has anyone been able to override a C library function? The code
I'm working
> with is based in C and needs to compile with both the default
Visual Studio
> Compiler and GCC so I don't believe LD_PRELOAD will work in this
case (which
> is what I turn up when searching Google).
>
>
>
> The goal behind this question is to build a shared library of
common code
> for our BREW (Qualcomm's Binary Runtime Environment for Wireless)
> applications. I'm trying to override library functions is because
the BREW
> implementations on different handsets to be "touchy" and each
handset has
> its own set of issues that can prevent code (that works on all the
other
> handsets) from running. This isn't a big deal with porting to 5
or 6
> handsets, but when we port to all handsets (usually 40 to 50
handsets)
> accounting for all of these issues makes the code exceptionally
messy.
>
>
>
> Thank you,
>
> Tom
>
>
> P.S. The BREW architect at my company did suggest writing a
custom vtable
> to help redirect functions from the standard set when needed and I
might be
> able to sell for latter applications, but the current stance on
this is that
> it would require too much rewriting of the current code.
>
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
__._,_.___
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
SPONSORED LINKS
| C programming language | Programming languages | Computer programming languages |
| Java programming language |
YAHOO! GROUPS LINKS
- Visit your group "c-prog" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
