Skip to content

Commit

Permalink
Allow build to succeed if NO_PERSISTENCE is defined #1391
Browse files Browse the repository at this point in the history
  • Loading branch information
icraggs committed Sep 3, 2024
1 parent 6494f22 commit 9ce9ce8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/MQTTAsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@ int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync
}


#if !defined(NO_PERSISTENCE)
int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* context, MQTTPersistence_beforeWrite* co)
{
int rc = MQTTASYNC_SUCCESS;
Expand Down Expand Up @@ -1709,6 +1710,7 @@ int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersi
FUNC_EXIT_RC(rc);
return rc;
}
#endif


void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
Expand Down
7 changes: 5 additions & 2 deletions src/MQTTAsync.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2022 IBM Corp., Ian Craggs and others
* Copyright (c) 2009, 2024 IBM Corp., Ian Craggs and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
Expand Down Expand Up @@ -104,6 +104,8 @@
#include "MQTTSubscribeOpts.h"
#if !defined(NO_PERSISTENCE)
#include "MQTTClientPersistence.h"
#else
#define MQTTCLIENT_PERSISTENCE_NONE 1
#endif

/**
Expand Down Expand Up @@ -507,6 +509,7 @@ typedef int MQTTAsync_updateConnectOptions(void* context, MQTTAsync_connectData*
*/
LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync_updateConnectOptions* co);

#if !defined(NO_PERSISTENCE)
/**
* Sets the MQTTPersistence_beforeWrite() callback function for a client.
* @param handle A valid client handle from a successful call to MQTTAsync_create().
Expand All @@ -529,7 +532,7 @@ LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* cont
* function. NULL removes the callback setting.
*/
LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersistence_afterRead* co);

#endif

/** The data returned on completion of an unsuccessful API call in the response callback onFailure. */
typedef struct
Expand Down
4 changes: 3 additions & 1 deletion src/MQTTClient.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2022 IBM Corp., Ian Craggs and others
* Copyright (c) 2009, 2024 IBM Corp., Ian Craggs and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
Expand Down Expand Up @@ -123,6 +123,8 @@
#include "MQTTSubscribeOpts.h"
#if !defined(NO_PERSISTENCE)
#include "MQTTClientPersistence.h"
#else
#define MQTTCLIENT_PERSISTENCE_NONE 1
#endif

/**
Expand Down

0 comments on commit 9ce9ce8

Please sign in to comment.