Skip to content

Commit ebbb0e5

Browse files
committed
drm: add extern C guard for the UAPI headers
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
1 parent 1224649 commit ebbb0e5

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎include/uapi/drm/drm.h‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ typedef unsigned long drm_handle_t;
6565

6666
#endif
6767

68+
#if defined(__cplusplus)
69+
extern "C" {
70+
#endif
71+
6872
#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
6973
#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
7074
#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
@@ -691,8 +695,16 @@ struct drm_prime_handle {
691695
__s32 fd;
692696
};
693697

698+
#if defined(__cplusplus)
699+
}
700+
#endif
701+
694702
#include "drm_mode.h"
695703

704+
#if defined(__cplusplus)
705+
extern "C" {
706+
#endif
707+
696708
#define DRM_IOCTL_BASE 'd'
697709
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
698710
#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
@@ -886,4 +898,8 @@ typedef struct drm_scatter_gather drm_scatter_gather_t;
886898
typedef struct drm_set_version drm_set_version_t;
887899
#endif
888900

901+
#if defined(__cplusplus)
902+
}
903+
#endif
904+
889905
#endif

‎include/uapi/drm/drm_fourcc.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
#include "drm.h"
2828

29+
#if defined(__cplusplus)
30+
extern "C" {
31+
#endif
32+
2933
#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
3034
((__u32)(c) << 16) | ((__u32)(d) << 24))
3135

@@ -229,4 +233,8 @@
229233
*/
230234
#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
231235

236+
#if defined(__cplusplus)
237+
}
238+
#endif
239+
232240
#endif /* DRM_FOURCC_H */

‎include/uapi/drm/drm_mode.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929

3030
#include "drm.h"
3131

32+
#if defined(__cplusplus)
33+
extern "C" {
34+
#endif
35+
3236
#define DRM_DISPLAY_INFO_LEN 32
3337
#define DRM_CONNECTOR_NAME_LEN 32
3438
#define DRM_DISPLAY_MODE_LEN 32
@@ -623,4 +627,8 @@ struct drm_mode_destroy_blob {
623627
__u32 blob_id;
624628
};
625629

630+
#if defined(__cplusplus)
631+
}
632+
#endif
633+
626634
#endif

‎include/uapi/drm/drm_sarea.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434

3535
#include "drm.h"
3636

37+
#if defined(__cplusplus)
38+
extern "C" {
39+
#endif
40+
3741
/* SAREA area needs to be at least a page */
3842
#if defined(__alpha__)
3943
#define SAREA_MAX 0x2000U
@@ -83,4 +87,8 @@ typedef struct drm_sarea_frame drm_sarea_frame_t;
8387
typedef struct drm_sarea drm_sarea_t;
8488
#endif
8589

90+
#if defined(__cplusplus)
91+
}
92+
#endif
93+
8694
#endif /* _DRM_SAREA_H_ */

0 commit comments

Comments
 (0)