Browse Source

Fix Qt build on OSX

Compiling boost::interprocess::message_queue against
boost 1.50 macports with -arch i386 (how releases are built,
for minimum download size and maximum compatibility) is failing:

src/qt/qtipcserver.cpp:37: error: no matching function for call to ‘boost::interprocess::message_queue_t<boost::interprocess::offset_ptr<void, int, long unsigned int, 0u> >::timed_receive(char (*)[257], long unsigned int, size_t&, unsigned int&, boost::posix_time::ptime&)’

This is probably a boost or macports bug, but since interprocess::message_queue
is only used for URI support, which isn't implemented on OSX anyway, I fixed
the build by #ifdef'ing out that code.
miguelfreitas
Gavin Andresen 13 years ago
parent
commit
4060d64fc9
  1. 7
      src/qt/bitcoin.cpp
  2. 15
      src/qt/qtipcserver.cpp

7
src/qt/bitcoin.cpp

@ -116,6 +116,8 @@ static void handleRunawayException(std::exception *e)
#ifndef BITCOIN_QT_TEST #ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// TODO: implement URI support on the Mac.
#if !defined(MAC_OSX)
// Do this early as we don't want to bother initializing if we are just calling IPC // Do this early as we don't want to bother initializing if we are just calling IPC
for (int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
{ {
@ -134,6 +136,7 @@ int main(int argc, char *argv[])
} }
} }
} }
#endif
// Internal string conversion is all UTF-8 // Internal string conversion is all UTF-8
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
@ -258,6 +261,8 @@ int main(int argc, char *argv[])
{ {
window.show(); window.show();
} }
// TODO: implement URI support on the Mac.
#if !defined(MAC_OSX)
// Place this here as guiref has to be defined if we dont want to lose URIs // Place this here as guiref has to be defined if we dont want to lose URIs
ipcInit(); ipcInit();
@ -276,7 +281,7 @@ int main(int argc, char *argv[])
} }
} }
} }
#endif
app.exec(); app.exec();
window.hide(); window.hide();

15
src/qt/qtipcserver.cpp

@ -20,6 +20,14 @@ using namespace boost::posix_time;
using namespace boost; using namespace boost;
using namespace std; using namespace std;
#ifdef MAC_OSX
// URI handling not implemented on OSX yet
void ipcInit() { }
void ipcShutdown() { }
#else
void ipcShutdown() void ipcShutdown()
{ {
message_queue::remove(BITCOINURI_QUEUE_NAME); message_queue::remove(BITCOINURI_QUEUE_NAME);
@ -50,11 +58,6 @@ void ipcThread(void* parg)
void ipcInit() void ipcInit()
{ {
#ifdef MAC_OSX
// TODO: implement bitcoin: URI handling the Mac Way
return;
#endif
message_queue* mq; message_queue* mq;
char strBuf[257]; char strBuf[257];
size_t nSize; size_t nSize;
@ -86,3 +89,5 @@ void ipcInit()
delete mq; delete mq;
} }
} }
#endif

Loading…
Cancel
Save