summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 30f3bb8db4b..390e524f7e1 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -133,7 +133,6 @@ Slice::Preprocessor::printMakefileDependencies(Language lang)
switch(lang)
{
case CPlusPlus:
- case Java: // Java ignores the leading .cpp filename.
{
char buf[1024];
while(fgets(buf, sizeof(buf), cppHandle) != NULL)
@@ -142,6 +141,24 @@ Slice::Preprocessor::printMakefileDependencies(Language lang)
}
break;
}
+ case Java:
+ {
+ char buf[1024];
+ while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ {
+ //
+ // Change the extension of the leading file from .cpp to .ice.
+ // This filename is ignored by Slice2JavaTask.
+ //
+ char* p = strstr(buf, ".cpp:");
+ if(p != NULL)
+ {
+ strncpy(p + 1, "ice", 3);
+ }
+ fputs(buf, stdout);
+ }
+ break;
+ }
case CSharp:
{
//