#include <sys/ioctl.h>
#include <stdio.h>
-#if !defined(TRUE)
-# define TRUE (1==1)
-#endif
-#if !defined(FALSE)
-# define FALSE (1==0)
-#endif
-
#include <stdlib.h>
static int fd;
-static int initialized = FALSE;
+static bool initialized = false;
extern "C" void
{
if (! initialized)
{
- initialized = TRUE;
+ initialized = true;
fd = open ("/dev/tty", O_RDONLY);
if (fd == -1)
{
#define gm2_printf __printf__
#endif
-#if !defined(TRUE)
-#define TRUE (1 == 1)
-#endif
-
-#if !defined(FALSE)
-#define FALSE (1 == 0)
-#endif
-
#if defined(TRACEON)
#define tprintf printf
#else
typedef struct threadSem_s
{
__gthread_cond_t counter;
- int waiting;
+ bool waiting;
int sem_value;
} threadSem;
/* These are used to lock the above module data structures. */
static __gthread_mutex_t lock; /* This is the only mutex for
the whole module. */
-static int initialized = FALSE;
+static int initialized = false;
extern "C" int EXPORT(init) (void);
initSem (threadSem *sem, int value)
{
__GTHREAD_COND_INIT_FUNCTION (&sem->counter);
- sem->waiting = FALSE;
+ sem->waiting = false;
sem->sem_value = value;
}
__gthread_mutex_lock (&lock);
if (sem->sem_value == 0)
{
- sem->waiting = TRUE;
+ sem->waiting = true;
__gthread_cond_wait (&sem->counter, &lock);
- sem->waiting = FALSE;
+ sem->waiting = false;
}
else
sem->sem_value--;
tprintf ("checking init\n");
if (! initialized)
{
- initialized = TRUE;
+ initialized = true;
tprintf ("RTco initialized\n");
__GTHREAD_MUTEX_INIT_FUNCTION (&lock);
#include <time.h>
#endif
-/* Define FALSE if one hasn't already been defined. */
-
-#if !defined(FALSE)
-#define FALSE (1 == 0)
-#endif
-
/* Define a generic NULL if one hasn't already been defined. */
#if !defined(NULL)
sizeof(double). */
return signbit (r);
#else
- return FALSE;
+ return false;
#endif
}
sizeof(double). */
return signbitl (r);
#else
- return FALSE;
+ return false;
#endif
}
sizeof(double). */
return signbitf (r);
#else
- return FALSE;
+ return false;
#endif
}
#if defined(FP_NAN) && defined(FP_INFINITE)
return (fpclassify (x) != FP_NAN && fpclassify (x) != FP_INFINITE);
#else
- return FALSE;
+ return false;
#endif
}
#if defined(FP_NAN) && defined(FP_INFINITE)
return (fpclassify (x) != FP_NAN && fpclassify (x) != FP_INFINITE);
#else
- return FALSE;
+ return false;
#endif
}
#if defined(FP_NAN) && defined(FP_INFINITE)
return (fpclassify (x) != FP_NAN && fpclassify (x) != FP_INFINITE);
#else
- return FALSE;
+ return false;
#endif
}