-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use static_assert() to validate that DDCA_Display_Event changes backw…
…ard compatible
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// Copyright (C) 2024 Sanford Rockowitz <[email protected]> | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include <assert.h> | ||
#include <glib-2.0/glib.h> | ||
|
||
#include "public/ddcutil_types.h" | ||
|
@@ -24,6 +25,24 @@ | |
// Trace class for this file | ||
static DDCA_Trace_Group TRACE_GROUP = DDCA_TRC_NONE; | ||
|
||
|
||
/** Use a static_assert() to ensure that the allocated size of | ||
* DDCA_Display_Status_Event is unchanged from that in a prior | ||
* release. | ||
*/ | ||
void assert_ddca_display_status_event_size_unchanged() { | ||
typedef struct { | ||
uint64_t timestamp_nanos; | ||
DDCA_Display_Event_Type event_type; | ||
DDCA_IO_Path io_path; | ||
char connector_name[32]; | ||
DDCA_Display_Ref dref; | ||
void * unused[2]; | ||
} DDCA_Display_Status_Event_2_1_4; | ||
|
||
static_assert(sizeof(DDCA_Display_Status_Event) == sizeof(DDCA_Display_Status_Event_2_1_4)); | ||
} | ||
|
||
// | ||
// Display Status Events | ||
// | ||
|