{"thread":{"id":"26195","subject":"[PATCH] quote.h: simplify the inclusion","startedAt":"2011-01-05T00:36:34Z","lastAt":"2011-01-05T00:36:34Z","messageCount":1,"participants":["Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"158928","messageId":"20110105003634.GA5128@burratino","threadId":"26195","inReplyTo":null,"subject":"[PATCH] quote.h: simplify the inclusion","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-01-05T00:36:34Z","receivedAt":"2011-01-05T00:36:34Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Attempting to include quote.h without first including strbuf.h results\nin warnings:\n\n ./quote.h:33:33: warning: ‘struct strbuf’ declared inside parameter list\n ./quote.h:33:33: warning: its scope is only this definition or declaration, which is probably not what you want\n ./quote.h:34:34: warning: ‘struct strbuf’ declared inside parameter list\n ...\n\nAdd a toplevel declaration for struct strbuf to avoid this.\n\nWhile at it, stop including system headers from quote.h.  git source\nfiles already need to include git-compat-util.h sooner to ensure the\nappropriate feature test macros are defined.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nNoticed while trying to use quote.h in a source file without strbufs.\n\n quote.h |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/quote.h b/quote.h\nindex 38003bf..024e21d 100644\n--- a/quote.h\n+++ b/quote.h\n@@ -1,8 +1,7 @@\n #ifndef QUOTE_H\n #define QUOTE_H\n \n-#include <stddef.h>\n-#include <stdio.h>\n+struct strbuf;\n \n /* Help to copy the thing properly quoted for the shell safety.\n  * any single quote is replaced with '\\'', any exclamation point\n-- \n1.7.4.rc0\n"}]}