Skip to content

Instantly share code, notes, and snippets.

@cwshu
Created June 3, 2017 15:30
Show Gist options
  • Save cwshu/c9e0c3c68837531b4a6119167842dc9b to your computer and use it in GitHub Desktop.
Save cwshu/c9e0c3c68837531b4a6119167842dc9b to your computer and use it in GitHub Desktop.
GNU readline 的 header 沒 include <stdio.h> , 這是 debian 幫 readline 打的 patch ....
rl-header.dpatch by <[email protected]>
Include stdio.h in readline.h and history.h
Index: b/history.h
===================================================================
--- a/history.h 2010-04-10 12:05:07.792336522 +0000
+++ b/history.h 2010-04-10 12:12:39.462336737 +0000
@@ -32,6 +32,7 @@
# include "rlstdc.h"
# include "rltypedefs.h"
#else
+# include <stdio.h>
# include <readline/rlstdc.h>
# include <readline/rltypedefs.h>
#endif
Index: b/readline.h
===================================================================
--- a/readline.h 2010-04-10 12:12:39.302337290 +0000
+++ b/readline.h 2010-04-10 12:12:39.462336737 +0000
@@ -32,6 +32,7 @@
# include "keymaps.h"
# include "tilde.h"
#else
+# include <stdio.h>
# include <readline/rlstdc.h>
# include <readline/rltypedefs.h>
# include <readline/keymaps.h>
@cwshu
Copy link
Author

cwshu commented Jun 3, 2017

來源: readline6_6.3-8.debian.tar.xz: debian/patches/rl-header.dpatch
https://packages.debian.org/jessie/libreadline6-dev

@cwshu
Copy link
Author

cwshu commented Jun 3, 2017

hmm, mailing list 找到資料了,看來上游認為這是正常的 style,使用者應該自己加 <stdio.h>
https://lists.gnu.org/archive/html/bug-readline/2008-12/msg00002.html
https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment