]> git.sur5r.net Git - cc65/blobdiff - src/cc65/pragma.c
Wrapper functions use all registers
[cc65] / src / cc65 / pragma.c
index 27015285e79d2a33bc979280ce2728fe94959f45..3dfc6266824cb9fd3de7d04fffbea84257185867 100644 (file)
@@ -51,7 +51,7 @@
 #include "scanstrbuf.h"
 #include "symtab.h"
 #include "pragma.h"
-#include "trampoline.h"
+#include "wrappedcall.h"
 
 
 
@@ -125,7 +125,7 @@ static const struct Pragma {
     { "static-locals",          PRAGMA_STATIC_LOCALS      },
     { "staticlocals",           PRAGMA_STATICLOCALS       },      /* obsolete */
     { "warn",                   PRAGMA_WARN               },
-    { "wrapped-call",           PRAGMA_WRAPPED_CALL      },
+    { "wrapped-call",           PRAGMA_WRAPPED_CALL       },
     { "writable-strings",       PRAGMA_WRITABLE_STRINGS   },
     { "zpsym",                  PRAGMA_ZPSYM              },
 };
@@ -468,7 +468,7 @@ static void WrappedCallPragma (StrBuf* B)
             break;
 
         case PP_POP:
-            PopTrampoline();
+            PopWrappedCall();
 
             /* Done */
             goto ExitPoint;
@@ -509,15 +509,16 @@ static void WrappedCallPragma (StrBuf* B)
     Entry = FindSym(Name);
 
     /* Check if the name is valid */
-    if (Entry && Entry->Flags & (SC_FUNC | SC_STORAGE)) {
+    if (Entry && Entry->Flags & SC_FUNC) {
 
-        PushTrampoline(Entry, Val);
+        PushWrappedCall(Entry, Val);
         Entry->Flags |= SC_REF;
+        Entry->V.F.Func->Flags |= FD_CALL_WRAPPER;
 
     } else {
 
         /* Segment name is invalid */
-        Error ("Wrapped-call target does not exist or is not a function or array");
+        Error ("Wrapped-call target does not exist or is not a function");
 
     }