Skip to Content.
Sympa Menu

freetds - Re: [freetds] Cross compilation, warnings and errors

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] Cross compilation, warnings and errors
  • Date: Tue, 25 Jan 2011 00:34:55 -0500

On Mon, 24 Jan 2011 13:09:45 -0300
Luis Lavena <luislavena AT gmail.com> wrote:

> Thank you for your complete and thoughtful response, but seems there
> is a confusion.
>
> Perhaps my english is not accurate, but what I pointed out is that
> during FreeTDS cross compilation I received the compilation error, not
> anything else.

There seems to be a rule on the Internet that anyone concerned that their
English is unclear in fact writes perfectly clearly. :-)

We're both a little confused. I didn't realize bsqldb.c included sqlfront.h
(it shouldn't).

But, when I build bsqdb, I don't see the symbol redefinition problem on
Linux, Win32, or Win64. (The latter two built using Microsoft's compiler du
jour.)

> That means FreeTDS headers are not evaluating for missing or defined
> symbols prior to define their own.

Correct: LPCBYTE is defined unconditionally as a typedef. Microsoft's
sqlfront.h does the same thing. I'm saying that's OK; if you have a
symbol-redefinition error, it's better not to include the *other* definition.
This code would *not* be correct in sqlfront.h:

#ifndef LPCBYTE
#define LPCBYTE /* ... */
#endif

because such code *assumes* the prior definition is equivalent to the one it
would define itself. That's not a safe assumption: LPCBYTE has no commonly
recognized meaning; there's no guarantee that the prior definition conforms
to FreeTDS's requirements.

My advice, then:

1. Substitute sybfront.h for sqlfront.h in src/apps/bsqldb.c. I think that
will fix the problem.

2. If not, look for a way to exclude unneeded defintions when including
windows.h. When using Microsoft's version, I define WINDOWS_LEAN_AND_MEAN
before including windows.h. What you'd need for mingw I don't know.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page