eclipse / paho.mqtt.embedded-c

Paho MQTT C client library for embedded systems. Paho is an Eclipse IoT project (https://iot.eclipse.org/)

Home Page:https://eclipse.org/paho

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTTClient.h: enum returnCode uses ubiquitous names prone for collisions

ottingerg opened this issue · comments

In our setup we are using the ST Hardware abstraction layer on an STM32F4 MCU.

We experience a collision of the enum name "SUCCESS" which is defined in MQTTClient.h:

enum returnCode { BUFFER_OVERFLOW = -2, FAILURE = -1, SUCCESS = 0 };

and also in stm32f4xx.h
typedef enum { ERROR = 0U, SUCCESS = !ERROR } ErrorStatus;

Using Prefixes (on both sides) for the enum would be our preferred way to resolve this issue.
Unfortunatly on the ST HAL side 'SUCCESS' is referred 1000+ times.

For example:
enum returnCode { MQTTCLIENT_BUFFER_OVERFLOW = -2,MQTTCLIENT_FAILURE = -1, MQTTCLIENT_SUCCESS = 0 };

Duplicate #180

Closing as duplicate. But yes we should do it.