longlongs.i 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* -----------------------------------------------------------------------------
  2. * longlongs.i
  3. *
  4. * Typemap addition for support of 'long long' type and 'unsigned long long
  5. * Makes use of swig-def-foreign-class, so this header should be loaded
  6. * after allegrocl.swg and after any custom user identifier-conversion
  7. * functions have been defined.
  8. * ----------------------------------------------------------------------------- */
  9. #ifdef Acl64Bit
  10. %typemap(ctype) long long, unsigned long long "$1_ltype";
  11. %typemap(out) long long, unsigned long long "$result = $1;";
  12. %typemap(ffitype) long long ":nat";
  13. %typemap(ffitype) unsigned long long ":unsigned-nat";
  14. %typemap(lout) long long, unsigned long long " #+64bit (cl::setq ACL_ffresult $body)";
  15. #else
  16. %typemap(out) long long, unsigned long long "$result = &$1;";
  17. %typemap(ffitype) long long "(:struct (l1 :long) (l2 :long))";
  18. %typemap(ffitype) unsigned long long "(:struct (l1 :unsigned-long) (l2 :unsigned-long))";
  19. %typemap(lout) long long
  20. " (cl::setq ACL_ffresult (make-instance '#.(swig-insert-id \"longlong\" () :type :class)
  21. :foreign-address $body))";
  22. %typemap(lout) unsigned long long
  23. " (cl:setq ACL_ffresult (make-instance '#.(swig-insert-id \"ulonglong\" () :type :class)
  24. :foreign-address $body))";
  25. #endif
  26. %typemap(in) long long, unsigned long long "$1 = $input;";
  27. %insert("lisphead") %{
  28. #-64bit
  29. (swig-def-foreign-class "longlong"
  30. (ff:foreign-pointer)
  31. (:struct (l1 :long) (l2 :long)))
  32. #-64bit
  33. (swig-def-foreign-class "ulonglong"
  34. (ff:foreign-pointer)
  35. (:struct (l1 :unsigned-long) (l2 :unsigned-long)))
  36. %}