--- mercury-compiler-0.12.2.orig/compiler/modules.m 2006-01-18 18:37:38.000000000 +1300 +++ mercury-compiler-0.12.2/compiler/modules.m 2006-11-23 20:26:45.000000000 +1300 @@ -3326,27 +3326,32 @@ ForeignImportedModules = [_ | _], ( Target = il, - ForeignImportTarget = DllFileName, + ForeignImportTargets = [DllFileName], ForeignImportExt = ".dll" ; Target = java, - ForeignImportTarget = ClassFileName, + ForeignImportTargets = [ClassFileName], ForeignImportExt = ".java" ; Target = c, - ForeignImportTarget = ObjFileName, + ForeignImportTargets = [ObjFileName, PicObjFileName], ForeignImportExt = ".mh" ; Target = asm, - ForeignImportTarget = ObjFileName, + ForeignImportTargets = [ObjFileName, PicObjFileName], ForeignImportExt = ".mh" ), - io__write_string(DepStream, "\n\n", !IO), - io__write_string(DepStream, ForeignImportTarget, !IO), - io__write_string(DepStream, " : ", !IO), - write_dependencies_list(ForeignImportedModules, ForeignImportExt, - DepStream, !IO), - io__write_string(DepStream, "\n\n", !IO) + WriteForeignImportTarget = (pred(ForeignImportTarget::in, + !.IO::di, !:IO::uo) is det :- + io__write_string(DepStream, "\n\n", !IO), + io__write_string(DepStream, ForeignImportTarget, !IO), + io__write_string(DepStream, " : ", !IO), + write_dependencies_list(ForeignImportedModules, + ForeignImportExt, DepStream, !IO), + io__write_string(DepStream, "\n\n", !IO) + ), + list.foldl(WriteForeignImportTarget, ForeignImportTargets, + !IO) ), (