Remove pointless compiler.h
This commit is contained in:
parent
86efc98a5e
commit
563a932659
5 changed files with 20 additions and 27 deletions
|
@ -6,7 +6,6 @@
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "compiler.h"
|
|
||||||
#include "drm.h"
|
#include "drm.h"
|
||||||
|
|
||||||
// From libdrm
|
// From libdrm
|
||||||
|
@ -15,6 +14,8 @@
|
||||||
#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
|
#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
|
||||||
#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
|
#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
|
||||||
|
|
||||||
|
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
|
||||||
|
|
||||||
int drm_set_master(int fd) {
|
int drm_set_master(int fd) {
|
||||||
return ioctl(fd, DRM_IOCTL_SET_MASTER, 0);
|
return ioctl(fd, DRM_IOCTL_SET_MASTER, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,10 @@
|
||||||
#error Unsupported platform
|
#error Unsupported platform
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "compiler.h"
|
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
|
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
|
||||||
|
|
||||||
int path_is_evdev(const char *path) {
|
int path_is_evdev(const char *path) {
|
||||||
static const char prefix[] = "/dev/input/event";
|
static const char prefix[] = "/dev/input/event";
|
||||||
static const size_t prefixlen = STRLEN(prefix);
|
static const size_t prefixlen = STRLEN(prefix);
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef _COMPILER_H
|
|
||||||
#define _COMPILER_H
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
|
||||||
#else
|
|
||||||
#define ATTRIB_PRINTF(start, end)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,20 +1,13 @@
|
||||||
#ifndef _LOG_H
|
#ifndef _LOG_H
|
||||||
#define _LOG_H
|
#define _LOG_H
|
||||||
|
|
||||||
#include "compiler.h"
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
enum libseat_log_level {
|
#ifdef __GNUC__
|
||||||
LIBSEAT_SILENT = 0,
|
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
||||||
LIBSEAT_ERROR = 1,
|
#else
|
||||||
LIBSEAT_INFO = 2,
|
#define ATTRIB_PRINTF(start, end)
|
||||||
LIBSEAT_DEBUG = 3,
|
#endif
|
||||||
LIBSEAT_LOG_LEVEL_LAST,
|
|
||||||
};
|
|
||||||
|
|
||||||
void libseat_log_init(enum libseat_log_level level);
|
|
||||||
|
|
||||||
void _libseat_logf(enum libseat_log_level level, const char *fmt, ...) ATTRIB_PRINTF(2, 3);
|
|
||||||
|
|
||||||
#ifdef LIBSEAT_REL_SRC_DIR
|
#ifdef LIBSEAT_REL_SRC_DIR
|
||||||
#define _LIBSEAT_FILENAME ((const char *)__FILE__ + sizeof(LIBSEAT_REL_SRC_DIR) - 1)
|
#define _LIBSEAT_FILENAME ((const char *)__FILE__ + sizeof(LIBSEAT_REL_SRC_DIR) - 1)
|
||||||
|
@ -48,4 +41,15 @@ void _libseat_logf(enum libseat_log_level level, const char *fmt, ...) ATTRIB_PR
|
||||||
#define log_debug(str)
|
#define log_debug(str)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum libseat_log_level {
|
||||||
|
LIBSEAT_SILENT = 0,
|
||||||
|
LIBSEAT_ERROR = 1,
|
||||||
|
LIBSEAT_INFO = 2,
|
||||||
|
LIBSEAT_DEBUG = 3,
|
||||||
|
LIBSEAT_LOG_LEVEL_LAST,
|
||||||
|
};
|
||||||
|
|
||||||
|
void libseat_log_init(enum libseat_log_level level);
|
||||||
|
void _libseat_logf(enum libseat_log_level level, const char *fmt, ...) ATTRIB_PRINTF(2, 3);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "backend.h"
|
#include "backend.h"
|
||||||
#include "compiler.h"
|
|
||||||
#include "libseat.h"
|
#include "libseat.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue