Commit aceb1737 authored by Robert Maynard's avatar Robert Maynard

Patch molequeue to compile with clang stdlib.

parent 4cb1ab3a
......@@ -11,6 +11,11 @@ endif()
add_external_project(molequeue
DEPENDS qt
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SuperBuild_PROJECTS_DIR}/patches/molequeue.transport.messageidmanager_p.cpp
<SOURCE_DIR>/molequeue/transport/messageidmanager_p.cpp
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=ON
-DENABLE_TESTING:BOOL=OFF
......
add_external_project(molequeue
DEPENDS qt
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SuperBuild_PROJECTS_DIR}/patches/molequeue.transport.messageidmanager_p.cpp
<SOURCE_DIR>/molequeue/transport/messageidmanager_p.cpp
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=ON
-DENABLE_TESTING:BOOL=OFF
......
/******************************************************************************
This source file is part of the MoleQueue project.
Copyright 2012 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/
#include "messageidmanager_p.h"
#include "message.h"
#include <stdlib.h>
namespace MoleQueue {
MessageIdManager *MessageIdManager::m_instance = NULL;
MessageIdManager::MessageIdManager()
: m_generator(0)
{
// Clean up when program exits.
atexit(&cleanup);
}
void MessageIdManager::init()
{
if (!m_instance)
m_instance = new MessageIdManager();
}
void MessageIdManager::cleanup()
{
delete m_instance;
m_instance = NULL;
}
MessageIdType MessageIdManager::registerMethod(const QString &method)
{
init();
double result = ++m_instance->m_generator;
m_instance->m_lookup.insert(result, method);
return MessageIdType(result);
}
QString MessageIdManager::lookupMethod(const MessageIdType &id)
{
init();
return id.isDouble() ? m_instance->m_lookup.take(id.toDouble()) : QString();
}
} // end namespace MoleQueue
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment