Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sprintf



>>>>> "Stephen" == Stephen J Turnbull <turnbull@example.com> writes:

>>>>> "Darren" == Darren Cook <darren@example.com> writes:

[ chomp ]
    Darren> But GCC 2.7.2 on a Sun has it defined (in stdio.h) as:

    Darren> extern char *sprintf _PARAMS((char *, const char *, ...));

[ chomp ]
    Darren> Is there a way to do something similar without having to
    Darren> rename sprintf in my code?

    Stephen> What's wrong with

    Stephen> #if GCC_ON_SUN
[ chomp ]

    Stephen> I'd put the replacement code in a "compatibility
    Stephen> library," though, which gets built only on the Sun
    Stephen> platform, and the declaration of
    Stephen> replacement_for_broken_Sun_sprintf in "portability.h" or
    Stephen> something like that.

And, by the way, #include "portability.h" *after* <stdio.h> OR ELSE!

Steve

-- 
                           Stephen John Turnbull
University of Tsukuba                                        Yaseppochi-Gumi
Institute of Policy and Planning Sciences  http://turnbull.sk.tsukuba.ac.jp/
Tennodai 1-1-1, Tsukuba, 305 JAPAN                 turnbull@example.com
-----------------------------------------------------------------
a word from the sponsor will appear below
-----------------------------------------------------------------
The TLUG mailing list is proudly sponsored by TWICS - Japan's First
Public-Access Internet System.  Now offering 20,000 yen/year flat
rate Internet access with no time charges.  Full line of corporate
Internet and intranet products are available.   info@example.com
Tel: 03-3351-5977   Fax: 03-3353-6096


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links