--- ./src/libmongoc/tests/unified/test-diagnostics.c.origin	2023-04-10 17:05:24.356000829 +0000
+++ ./src/libmongoc/tests/unified/test-diagnostics.c	2023-04-12 08:58:31.990951726 +0000
@@ -21,14 +21,15 @@
 #include "common-thread-private.h"
 #include <signal.h>
 
-typedef struct _msg_t {
+//msg_t conflict with sys/localedef31.h, so renaming it. 
+typedef struct _diagnostics_msg_t {
    char *string;
-   struct _msg_t *next;
-} msg_t;
+   struct _diagnostics_msg_t *next;
+} diagnostics_msg_t;
 
 typedef struct {
-   msg_t *test_info;
-   msg_t *error_info;
+   diagnostics_msg_t *test_info;
+   diagnostics_msg_t *error_info;
    bson_mutex_t mutex;
 } test_diagnostics_t;
 
@@ -37,7 +38,7 @@
 static char *
 test_diagnostics_error_string (bson_error_t *error)
 {
-   msg_t *msg_iter = NULL;
+   diagnostics_msg_t *msg_iter = NULL;
    bson_string_t *str = NULL;
    test_diagnostics_t *td = &diagnostics;
 
@@ -102,7 +103,7 @@
 test_diagnostics_reset (void)
 {
    test_diagnostics_t *td = &diagnostics;
-   msg_t *iter, *iter_tmp;
+   diagnostics_msg_t *iter, *iter_tmp;
 
    LL_FOREACH_SAFE (td->test_info, iter, iter_tmp)
    {
@@ -135,14 +136,14 @@
 {
    test_diagnostics_t *td = &diagnostics;
    va_list args;
-   msg_t *msg = NULL;
+   diagnostics_msg_t *msg = NULL;
    char *msg_string;
 
    va_start (args, fmt);
    msg_string = bson_strdupv_printf (fmt, args);
    va_end (args);
 
-   msg = bson_malloc0 (sizeof (msg_t));
+   msg = bson_malloc0 (sizeof (diagnostics_msg_t));
    msg->string = msg_string;
 
    bson_mutex_lock (&td->mutex);
