From ac192381111ab6faf357a598dca47598935c61d9 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Mon, 12 Jul 2004 17:32:08 +0000 Subject: change extension of leading file from .cpp to .ice for Java --- cpp/src/Slice/Preprocessor.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'cpp/src/Slice/Preprocessor.cpp') 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: { // -- cgit v1.2.3