[vlc-commits] [Git][videolan/vlc][master] 3 commits: vlc_sout: don't force extern C on other headers

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 20 14:14:04 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ed2736b8 by Steve Lhomme at 2023-04-20T13:43:09+00:00
vlc_sout: don't force extern C on other headers

They might define some C++ code.

- - - - -
daf9ecb7 by Steve Lhomme at 2023-04-20T13:43:09+00:00
vlc_picture: don't force extern C on other headers

They might define some C++ code.

- - - - -
1b834066 by Steve Lhomme at 2023-04-20T13:43:09+00:00
vlc_fixups: don't include system headers with forced extern "C"

- - - - -


3 changed files:

- include/vlc_fixups.h
- include/vlc_picture.h
- include/vlc_sout.h


Changes:

=====================================
include/vlc_fixups.h
=====================================
@@ -454,11 +454,18 @@ void swab (const void *, void *, ssize_t);
 
 /* Socket stuff */
 #ifndef HAVE_INET_PTON
+# ifdef __cplusplus
+}
+# endif
 # ifndef _WIN32
 #  include <sys/socket.h>
 #else
 typedef int socklen_t;
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 int inet_pton(int, const char *, void *);
 const char *inet_ntop(int, const void *, char *, socklen_t);
 #endif
@@ -491,7 +498,13 @@ int poll (struct pollfd *, unsigned, int);
 #endif
 
 #ifndef HAVE_IF_NAMEINDEX
+# ifdef __cplusplus
+}
+# endif
 #include <errno.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
 # ifndef HAVE_STRUCT_IF_NAMEINDEX
 struct if_nameindex
 {
@@ -529,7 +542,13 @@ struct msghdr
 };
 
 # ifndef HAVE_IF_NAMETOINDEX
+#  ifdef __cplusplus
+}
+#  endif
 #  include <stdlib.h> /* a define may change from the real atoi declaration */
+#  ifdef __cplusplus
+extern "C" {
+#  endif
 static inline int if_nametoindex(const char *name)
 {
     return atoi(name);
@@ -746,7 +765,13 @@ char *realpath(const char * restrict pathname, char * restrict resolved_path);
 #ifdef __APPLE__
 # define fdatasync fsync
 
+# ifdef __cplusplus
+}
+# endif
 # include <time.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
 # ifndef TIMER_ABSTIME
 #  define TIMER_ABSTIME 0x01
 # endif
@@ -766,7 +791,13 @@ int clock_getres(clockid_t clock_id, struct timespec *tp);
 
 #ifndef _WIN32
 # ifndef HAVE_CLOCK_NANOSLEEP
+#  ifdef __cplusplus
+}
+#  endif
 # include <time.h>
+#  ifdef __cplusplus
+extern "C" {
+#  endif
 int clock_nanosleep(clockid_t clock_id, int flags,
         const struct timespec *rqtp, struct timespec *rmtp);
 # endif


=====================================
include/vlc_picture.h
=====================================
@@ -27,6 +27,7 @@
 
 #include <assert.h>
 #include <vlc_atomic.h>
+#include <vlc_es.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,8 +44,6 @@ typedef uint32_t vlc_ancillary_id;
  * This file defines picture structures and functions in vlc
  */
 
-#include <vlc_es.h>
-
 /** Description of a planar graphic field */
 typedef struct plane_t
 {


=====================================
include/vlc_sout.h
=====================================
@@ -27,14 +27,14 @@
 #ifndef VLC_SOUT_H_
 #define VLC_SOUT_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <sys/types.h>
 #include <vlc_es.h>
 #include <vlc_clock.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * \defgroup sout Stream output
  * \ingroup output



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/48a6b25031c13d179632d31ecd3c9a72f271e35a...1b834066f37d9c303f2d8aaef116250d7c17b6ef

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/48a6b25031c13d179632d31ecd3c9a72f271e35a...1b834066f37d9c303f2d8aaef116250d7c17b6ef
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list