mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-05 17:08:02 +02:00
Add C++ header guards
And a basic build test for C++ to make sure including the headers doesn't completely fail. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
27cab50172
commit
631fb3c0af
4 changed files with 36 additions and 0 deletions
|
|
@ -276,6 +276,14 @@ executable('test-build-libreis',
|
|||
c_args : ['-Werror', '-DINCLUDE_LIBREIS=1'],
|
||||
install : false)
|
||||
|
||||
if add_languages('cpp', required: false)
|
||||
executable('test-build-cxx',
|
||||
'test/buildtest.cc',
|
||||
dependencies: [dep_libei, dep_libeis],
|
||||
include_directories: 'src',
|
||||
install: false)
|
||||
endif
|
||||
|
||||
configure_file(output: 'config.h', configuration: config_h)
|
||||
|
||||
if get_option('documentation')
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
|
@ -881,3 +885,7 @@ ei_event_get_time(struct ei_event *event);
|
|||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -597,3 +601,7 @@ eis_event_touch_get_y(struct eis_event *event);
|
|||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
12
test/buildtest.cc
Normal file
12
test/buildtest.cc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <libei.h>
|
||||
#include <libeis.h>
|
||||
|
||||
/* This is a build-test only */
|
||||
|
||||
using namespace std;
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue