[EMAIL PROTECTED] wrote:
Aieee!  This one has to do with a really, really nasty problem.  There are
at least three different kinds of strerror_r() about:

 * the AIX version, which is no big problem and so I'll ignore it here;
 * the Single Unix Specification or SUS one, which returns int;
 * the GNU version, which returns char *.

Detecting the difference between the latter two at build time is really
hard because they take the exact same arguments!  This wouldn't be a
problem if we could afford to ignore the returned value, but with the GNU
version, we can't.  We need special-case code for these, selected at build
time.

What about simply doing something like:


  inline static void foo(const char*)
  {
    // do something with const char*
  }

  inline static void foo(int)
  {
    // do something with int
  }

  void bar()
  {
    foo(strerror_r(/* ... */));
  }


Any decent compiler will optimize away the version of foo() that isn't needed, and no configuring necessary -- except for the AIX version perhaps.

--Bart
_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to