ERROR macro: get rid of the many 'oddly, ERROR is not defined for c++', use PX4_ERROR

This commit is contained in:
Beat Küng
2016-09-30 13:50:51 +02:00
committed by Julian Oes
parent c606554da3
commit 241fd629ce
42 changed files with 207 additions and 504 deletions
@@ -39,8 +39,7 @@
*/
#include <px4_config.h>
//#include <drivers/device/i2c.h>
#include <px4_defines.h>
#include <sys/types.h>
#include <stdint.h>
@@ -55,10 +54,6 @@
#include <math.h>
#include <unistd.h>
//#include <nuttx/arch.h>
//#include <nuttx/wqueue.h>
//#include <nuttx/clock.h>
#include <px4_workqueue.h>
#include <arch/board/board.h>
@@ -79,12 +74,6 @@
/* Default I2C bus */
#define PX4_I2C_BUS_DEFAULT PX4_I2C_BUS_EXPANSION
/* Oddly, ERROR is not defined for C++ */
#ifdef ERROR
# undef ERROR
#endif
static const int ERROR = -1;
#ifndef CONFIG_SCHED_WORKQUEUE
# error This requires CONFIG_SCHED_WORKQUEUE.
#endif
@@ -37,6 +37,7 @@
*/
#include <sys/types.h>
#include <px4_defines.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
@@ -72,12 +73,6 @@ using namespace DriverFramework;
#define TIMEOUT_5HZ 500
#define RATE_MEASUREMENT_PERIOD 5000000
/* oddly, ERROR is not defined for c++ */
#ifdef ERROR
# undef ERROR
#endif
static const int ERROR = -1;
/* class for dynamic allocation of satellite info data */
class GPS_Sat_Info
{
@@ -220,7 +215,7 @@ GPSSIM::~GPSSIM()
int
GPSSIM::init()
{
int ret = ERROR;
int ret = PX4_ERROR;
/* do regular cdev init */
if (VirtDevObj::init() != OK) {