Commit 33a701cd authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Use cmakedefine01

This way we get a build time warning if the var isn't defined at all, e.g.
a missing check_include_files() CMake call.
parent c9b32b75
Pipeline #189081 passed with stage
in 3 minutes and 21 seconds
......@@ -7,6 +7,6 @@
#ifndef KOSMINDOORMAP_CONFIG_H
#define KOSMINDOORMAP_CONFIG_H
#cmakedefine HAVE_KOPENINGHOURS
#cmakedefine01 HAVE_KOPENINGHOURS
#endif
......@@ -8,7 +8,7 @@
#include "openinghourscache_p.h"
#include "logging.h"
#ifdef HAVE_KOPENINGHOURS
#if HAVE_KOPENINGHOURS
#include <KOpeningHours/Interval>
#include <KOpeningHours/OpeningHours>
#endif
......@@ -42,7 +42,7 @@ void OpeningHoursCache::setTimeRange(const QDateTime &begin, const QDateTime &en
bool OpeningHoursCache::isClosed(OSM::Element elem, const QByteArray &oh)
{
#ifndef HAVE_KOPENINGHOURS
#if !HAVE_KOPENINGHOURS
Q_UNUSED(elem);
Q_UNUSED(oh);
return false;
......
......@@ -4,4 +4,4 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#cmakedefine HAVE_PROTOBUF
#cmakedefine01 HAVE_PROTOBUF
......@@ -7,7 +7,7 @@
#include "config-kosm.h"
#include "osmpbfparser.h"
#ifdef HAVE_PROTOBUF
#if HAVE_PROTOBUF
#include "fileformat.pb.h"
#include "osmformat.pb.h"
......@@ -28,7 +28,7 @@ OsmPbfParser::OsmPbfParser(DataSet *dataSet)
void OsmPbfParser::parse(const uint8_t *data, std::size_t len)
{
#ifdef HAVE_PROTOBUF
#if HAVE_PROTOBUF
const uint8_t *it = data;
const uint8_t *end = data + len;
while (parseBlob(it, end));
......@@ -40,7 +40,7 @@ void OsmPbfParser::parse(const uint8_t *data, std::size_t len)
#endif
}
#ifdef HAVE_PROTOBUF
#if HAVE_PROTOBUF
bool OsmPbfParser::parseBlob(const uint8_t *&it, const uint8_t *end)
{
if (std::distance(it, end) < (int)sizeof(int32_t)) {
......
Supports Markdown
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