1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Update getDependencyExtensions to add the "h" extension to the C++ header file content type. This is a temporary fix.

This commit is contained in:
Leo Treggiari 2005-12-15 22:25:40 +00:00
parent 512462b093
commit 4c4be88fab

View file

@ -826,7 +826,29 @@ public class InputType extends BuildObject implements IInputType {
// Use content type if specified and registered with Eclipse
IContentType type = getDependencyContentType();
if (type != null) {
return ((Tool)tool).getContentTypeFileSpecs(type);
String[] exts = ((Tool)tool).getContentTypeFileSpecs(type);
// TODO: This is a temporary hack until we decide how to specify the langauge (C vs. C++)
// of a .h file. If the content type is the CDT-defined C/C++ content type, then
// add "h" to the list if it is not already there.
if (type.getId().compareTo("org.eclipse.cdt.core.cxxHeader") == 0) { // $NON-NLS-1$
boolean h_found = false;
for (int i=0; i<exts.length; i++) {
if (exts[i].compareTo("h") == 0) { // $NON-NLS-1$
h_found = true;
break;
}
}
if (!h_found) {
String[] cppexts = new String[exts.length+1];
int i = 0;
for (; i<exts.length; i++) {
cppexts[i] = exts[i];
}
cppexts[i] = "h"; // $NON-NLS-1$
return cppexts;
}
}
return exts;
}
return getDependencyExtensionsAttribute();
}