From 857b89e3f49b1e75db821242764368fa84ee8f0e Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 14 Sep 2008 14:36:11 +0200 Subject: [PATCH] Fix #88 : pragma(lib, "str") is now converted to -lstr in the linker command line. --- gen/toir.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 6a3a080c..aaa1ad62 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -21,6 +21,7 @@ #include "template.h" #include "hdrgen.h" #include "port.h" +#include "mem.h" #include "gen/irstate.h" #include "gen/logger.h" @@ -2551,9 +2552,12 @@ int TypedefDeclaration::cvMember(unsigned char*) return 0; } -void obj_includelib(char*) +void obj_includelib(char* lib) { -// FIXME: we want to support pragma(lib) + char *arg = (char *)mem.malloc(64); + strcpy(arg, "-l"); + strncat(arg, lib, 64); + global.params.linkswitches->push(arg); } void backend_init()