From 82ce3587f63396724dfbfcf0bfc564d56f23f224 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Wed, 9 Apr 2008 16:13:40 +0000 Subject: [PATCH] recognize more files: *.hh, #pragma --- clang.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang.c b/clang.c index 68ed0c1..e8acc94 100644 --- a/clang.c +++ b/clang.c @@ -45,7 +45,7 @@ static const char *c_mode_types = "_Bool|_Complex|_Imaginary|"; static const char *c_mode_extensions = - "c|h|y|e|cc|cs|cpp|cxx|hpp|hxx|idl|jav|java|js|qe|json|pcc|C|l|lex"; + "c|h|y|e|cc|hh|cpp|hpp|cxx|hxx|cs|idl|jav|java|js|qe|json|pcc|C|l|lex"; #if 0 static int get_c_identifier(char *buf, int buf_size, unsigned int *p) @@ -606,6 +606,10 @@ static int c_mode_probe(ModeProbeData *p) if (p->buf[0] == '/' && p->buf[1] == '/') return 50; + /* same for file starting with '#pragma' as in #pragma once */ + if (strstart(cs8(p->buf), "#pragma", NULL)) + return 50; + return 0; }