Skip to Content.
Sympa Menu

freetds - [freetds] including readpassphrase.h

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Craig A. Berry" <craigberry AT mac.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] including readpassphrase.h
  • Date: Sun, 18 Dec 2005 22:01:54 -0600

We currently include readpassphrase.h in include/replacements.h like so:


#if !HAVE_READPASSPHRASE
# include <../src/replacements/readpassphrase.h>
#else
# include <readpassphrase.h>
#endif

In cases where we actually need the replacement, this is problematic for
a couple of different reasons, the most serious being that
readpassphrase.h surrounds all of its compiler-visible contents with:

#ifndef HAVE_READPASSPHRASE

However, the FreeTDS way of doing things will make HAVE_READPASSPHRASE
defined, but defined to a false value, so if we have what's required to
include the replacement readpassphrase.h, we also guarantee that nothing
in it will be visible to the compiler.

The other issue is that it seems to me

# include <../src/replacements/readpassphrase.h>

has far too much information hard-coded about where the include file is found and what directory I happen to be in when I'm compiling.

We could solve both problems by doing the following:

--- include/replacements.h;-0 Fri Jul 8 03:22:52 2005
+++ include/replacements.h Sun Dec 18 16:13:06 2005
@@ -53,8 +53,8 @@
char *strtok_r(char *str, const char *sep, char **lasts);
#endif /* !HAVE_STRTOK_R */

-#if !HAVE_READPASSPHRASE
-# include <../src/replacements/readpassphrase.h>
+#ifndef HAVE_READPASSPHRASE
+# include "readpassphrase.h"
#else
# include <readpassphrase.h>
#endif
[end of patch]

and then add whatever -I directives are necessary to make the include
file findable. (The easy way to do the latter, of course, would be to
simply move it from src/replacments to include/).

Does this make sense?




Archive powered by MHonArc 2.6.24.

Top of Page