* Don't define DEBUG in public headers!!! Doing it this way will break the
build for others, namely those that also include <Debug.h> * This fixes the remaining problems of building Pe under Haiku. * Those files need a giant style cleanup... Fredrik, time to have a look at our style guide :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26931 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,8 +16,6 @@
|
|||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#define DEBUG
|
|
||||||
|
|
||||||
class BList;
|
class BList;
|
||||||
class BString;
|
class BString;
|
||||||
struct entry_ref;
|
struct entry_ref;
|
||||||
@@ -130,7 +128,7 @@ virtual status_t _Reserved_Joystick_6(void *, ...);
|
|||||||
uint32 _reserved_Joystick_[10];
|
uint32 _reserved_Joystick_[10];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
public:
|
public:
|
||||||
static FILE *sLogFile;
|
static FILE *sLogFile;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Haiku.
|
* Copyright 2008, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Fredrik Modeen
|
* Fredrik Modeen
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "joystick_driver.h"
|
#include "joystick_driver.h"
|
||||||
@@ -22,8 +21,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define DEBUG
|
|
||||||
|
|
||||||
#define DEVICEPATH "/dev/joystick/"
|
#define DEVICEPATH "/dev/joystick/"
|
||||||
#define JOYSTICKPATH "/boot/home/config/settings/joysticks/"
|
#define JOYSTICKPATH "/boot/home/config/settings/joysticks/"
|
||||||
|
|
||||||
@@ -47,7 +44,7 @@ private:
|
|||||||
status_t save_config(const entry_ref * ref = NULL);
|
status_t save_config(const entry_ref * ref = NULL);
|
||||||
status_t get_info();
|
status_t get_info();
|
||||||
BJoystick* fJoystick;
|
BJoystick* fJoystick;
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
public:
|
public:
|
||||||
static FILE *sLogFile;
|
static FILE *sLogFile;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,9 +25,17 @@ __8JoyCalibG5BRectR9BJoystickP7BWindow:
|
|||||||
|
|
||||||
#include "Joystick.h"
|
#include "Joystick.h"
|
||||||
|
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
inline void LOG(const char *fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); \
|
inline void
|
||||||
fputs(buf, BJoystick::sLogFile); fflush(BJoystick::sLogFile); }
|
LOG(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vsprintf(buf, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
fputs(buf, BJoystick::sLogFile); fflush(BJoystick::sLogFile);
|
||||||
|
}
|
||||||
# define LOG_ERR(text...) LOG(text)
|
# define LOG_ERR(text...) LOG(text)
|
||||||
FILE *BJoystick::sLogFile = NULL;
|
FILE *BJoystick::sLogFile = NULL;
|
||||||
#else
|
#else
|
||||||
@@ -40,11 +48,12 @@ FILE *BJoystick::sLogFile = NULL;
|
|||||||
#include "JoystickTweaker.h"
|
#include "JoystickTweaker.h"
|
||||||
|
|
||||||
BJoystick::BJoystick()
|
BJoystick::BJoystick()
|
||||||
: _mBeBoxMode(false)
|
:
|
||||||
, _fDevices(new BList)
|
_mBeBoxMode(false),
|
||||||
, m_info(new _joystick_info())
|
_fDevices(new BList),
|
||||||
|
m_info(new _joystick_info())
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
sLogFile = fopen("/var/log/libdevice.log", "a");
|
sLogFile = fopen("/var/log/libdevice.log", "a");
|
||||||
#endif
|
#endif
|
||||||
//ScanDevices();
|
//ScanDevices();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <UTF8.h>
|
#include <UTF8.h>
|
||||||
|
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
inline void LOG(const char *fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); \
|
inline void LOG(const char *fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); \
|
||||||
fputs(buf, _BJoystickTweaker::sLogFile); fflush(_BJoystickTweaker::sLogFile); }
|
fputs(buf, _BJoystickTweaker::sLogFile); fflush(_BJoystickTweaker::sLogFile); }
|
||||||
#define LOG_ERR(text...) LOG(text)
|
#define LOG_ERR(text...) LOG(text)
|
||||||
@@ -33,7 +33,7 @@ FILE *_BJoystickTweaker::sLogFile = NULL;
|
|||||||
_BJoystickTweaker::_BJoystickTweaker()
|
_BJoystickTweaker::_BJoystickTweaker()
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
sLogFile = fopen("/var/log/libdevice.log", "a");
|
sLogFile = fopen("/var/log/libdevice.log", "a");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ _BJoystickTweaker::_BJoystickTweaker()
|
|||||||
_BJoystickTweaker::_BJoystickTweaker(BJoystick &stick)
|
_BJoystickTweaker::_BJoystickTweaker(BJoystick &stick)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
#ifdef DEBUG
|
#if DEBUG
|
||||||
sLogFile = fopen("/var/log/libdevice.log", "a");
|
sLogFile = fopen("/var/log/libdevice.log", "a");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user