Re: Build failure on OSX (Solved) - Mailing list pgadmin-hackers

From Florian G. Pflug
Subject Re: Build failure on OSX (Solved)
Date
Msg-id 444BD347.7020101@phlo.org
Whole thread Raw
In response to Re: Build failure on OSX  ("Florian G. Pflug" <fgp@phlo.org>)
List pgadmin-hackers
Florian G. Pflug wrote:
> OpenMacNews wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: RIPEMD160
>>
>>> I'm getting linker error on OSX since about two days. Any idea why the
>>> symbol __ftol is missing,
>>> and which library should provide it?
>> ...
>>> /Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib/libpq.a   -lssl -lcrypto
>>> ld: Undefined symbols:
>>> __ftol
>> ...

I found the error. misc.cpp defines _ftol or _ftol2 as "extern". Whoever
added that code seems to have believed that "#if (_MSC_VER < 1300)" will
evaluate to false if _MSC_VER is not defined ;-) It doesn't, howerver,
so this needs wrapping inside "#ifdef WIN32".

Heres a patch, please apply.

Index: src/utils/misc.cpp
===================================================================
--- src/utils/misc.cpp  (revision 5084)
+++ src/utils/misc.cpp  (working copy)
@@ -428,9 +428,10 @@
  }
  #endif

+#ifdef WIN32
  #if (_MSC_VER < 1300)
  /* _ftol2 is more than VC7. */
  extern "C" long _ftol( double );
  extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
  #endif
-
+#endif

mfg, Florian Pflug

pgadmin-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Build failure on OSX
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r5085 - trunk/pgadmin3/src/utils