Skip to contentSkip to conversation

Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

PATCH New Petr Vorel 2 participants 6 messages Feb 9, 2018 – Feb 14, 2018

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

From: Khem Raj <[email protected]>

__BEGIN_DECLS and __END_DECLS definitions are missing (at least) in musl libc.

Issue was reported in openembedded-core project [1] and netinet/sctp.h was fixed in upstream [2].

[1] http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
[2] https://github.com/sctp/lksctp-tools/commit/1329bea90f55d3e69820cfb5203b53794d4c6bc0

CC Anders Roxell <[email protected]>

---
NOTE: removed this from commit:
Include <asm-generic/types.h> to get __s32 definitions its not a generally available typedef

Kind regards,
Petr

---
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------
 utils/sctp/include/netinet/sctp.h                |    8 +-
 4 files changed, 2812 insertions(+), 3190 deletions(-)
testcases/kernel/syscalls/epoll2/include/epoll.h +6 -2
index be599c761..8cc5e7ef0 100644
@@ -85,7 +85,9 @@ struct epoll_event
 } EPOLL_PACKED;
 
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Creates an epoll instance.  Returns an fd for the new instance.
    The "size" parameter is a hint specifying the number of file
@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
 extern int epoll_wait (int __epfd, struct epoll_event *__events,
 		       int __maxevents, int __timeout) __THROW;
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* sys/epoll.h */
utils/ffsb-6.0-rc2/config.h.in +33 -16

68 lines not on this page · raw message

utils/ffsb-6.0-rc2/configure +2767 -3170

2,913 lines not on this page · raw message

utils/sctp/include/netinet/sctp.h +6 -2
index 51f5bfb84..47571cd08 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.16.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

Hi!

Quoted 3 lines
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------

^
This does not look like intended change, can you please revert the patch and apply clean version?

(Have you used git commit -a by mistake?)

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

Hi Cyril,

Quoted 8 lines
Quoted 3 lines
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------

^
This does not look like intended change, can you please revert the patch and apply clean version?

(Have you used git commit -a by mistake?)

I'm sorry for mistake. I reverted it and commit again.

I wish there was a commit of ffsb configure files with recent/common autotools version as I keep reverting them often. But it's a question, what is common autotools version.

Kind regards,
Petr

#3 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

Hi!

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------

^
This does not look like intended change, can you please revert the patch and apply clean version?

(Have you used git commit -a by mistake?)

I'm sorry for mistake. I reverted it and commit again.

No problem at all.

Quoted 2 lines

I wish there was a commit of ffsb configure files with recent/common autotools version as I keep reverting them often. But it's a question, what is common autotools version.

Looked shortly into the problem, it looks like the problem is Makefile generated by automake decides to regenerate configure script because timestamps are not preserved on git checkout and the build system thinks that configure script is out of date since it's older than the files it has been generated from. Looks like this is a common problem see:

https://www.gnu.org/software/automake/manual/html_node/CVS.html

One of the solutions would be to regenerate the configure with AM_MAINTAINER_MODE() which should disable the automagic regeneration.

Also side note, I've learned not to use git commit -a after one of the screw ups or at least check the resulting patch for unintended changes.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#4 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

Hi Cyril,

Quoted 21 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------

^
This does not look like intended change, can you please revert the patch and apply clean version?

(Have you used git commit -a by mistake?)

I'm sorry for mistake. I reverted it and commit again.

No problem at all.

Quoted 2 lines

I wish there was a commit of ffsb configure files with recent/common autotools version as I keep reverting them often. But it's a question, what is common autotools version.

Looked shortly into the problem, it looks like the problem is Makefile generated by automake decides to regenerate configure script because timestamps are not preserved on git checkout and the build system thinks that configure script is out of date since it's older than the files it has been generated from. Looks like this is a common problem see:

Quoted 4 lines

https://www.gnu.org/software/automake/manual/html_node/CVS.html

One of the solutions would be to regenerate the configure with AM_MAINTAINER_MODE() which should disable the automagic regeneration.

Thanks for investigation! I'm for using it (better than have some scripts like gcc folks as mentioned there as an alternative).

Quoted 2 lines

Also side note, I've learned not to use git commit -a after one of the screw ups or at least check the resulting patch for unintended changes.

Well, I wasn't using '-a' switch. Custom function is sometimes even worse than '-a' switch :-).

Kind regards,
Petr

author
#5 lore raw

PATCH 1/1 Replace __BEGIN_DECLS and __END_DECLS to with expanded macros

In reply to Cyril Hrubis

Hi Cyril,

Quoted 21 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
 testcases/kernel/syscalls/epoll2/include/epoll.h |    8 +-
 utils/ffsb-6.0-rc2/config.h.in                   |   49 +-
 utils/ffsb-6.0-rc2/configure                     | 5937 ++++++++++------------

^
This does not look like intended change, can you please revert the patch and apply clean version?

(Have you used git commit -a by mistake?)

I'm sorry for mistake. I reverted it and commit again.

No problem at all.

Quoted 2 lines

I wish there was a commit of ffsb configure files with recent/common autotools version as I keep reverting them often. But it's a question, what is common autotools version.

Looked shortly into the problem, it looks like the problem is Makefile generated by automake decides to regenerate configure script because timestamps are not preserved on git checkout and the build system thinks that configure script is out of date since it's older than the files it has been generated from. Looks like this is a common problem see:

Quoted 4 lines

https://www.gnu.org/software/automake/manual/html_node/CVS.html

One of the solutions would be to regenerate the configure with AM_MAINTAINER_MODE() which should disable the automagic regeneration.

Tested and pushed as 427b1be9c ("configure.ac: Enable maintainer mode").

Kind regards,
Petr