openpgm/Mark-pgm_family_string-as-inline.patch
Dirk Mueller a2d0578140 Accepting request 1093660 from home:bluca:branches:devel:libraries:c_c++
- Add Mark-pgm_family_string-as-inline.patch to fix building packages that
  include the PGM headers without using pgm_family_string() by marking it
  'inline' to avoid unused-function warnings. Sent upstream:
  https://github.com/steve-o/openpgm/pull/74

OBS-URL: https://build.opensuse.org/request/show/1093660
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/openpgm?expand=0&rev=32
2023-06-18 18:43:24 +00:00

25 lines
1019 B
Diff

Author: Luca Boccassi <bluca@debian.org>
Description: Mark pgm_family_string as 'inline'
Functions defined in headers need to be 'static inline', otherwise the compiler
will generate an unused-function warning for every program that includes the
header but doesn't use the function.
In file included from /usr/include/pgm-5.3/pgm/skbuff.h:39,
from /usr/include/pgm-5.3/pgm/msgv.h:33,
from /usr/include/pgm-5.3/pgm/pgm.h:44,
from src/ip.cpp:53:
/usr/include/pgm-5.3/pgm/socket.h:207:1: error: 'const char* pgm_family_string(int)' defined but not used [-Werror=unused-function]
207 | pgm_family_string (
| ^~~~~~~~~~~~~~~~~
--- pgm.orig/include/pgm/socket.h
+++ pgm/include/pgm/socket.h
@@ -202,7 +202,7 @@ int pgm_wsapoll_info (pgm_sock_t*const restrict, WSAPOLLFD*const restrict, ULONG
int pgm_epoll_ctl (pgm_sock_t*const, const int, const int, const int);
#endif
-static
+static inline
const char*
pgm_family_string (
const int family