See CHANGES.current
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5900 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1439a8f7c9
commit
53db012b12
3 changed files with 45 additions and 13 deletions
|
|
@ -1,6 +1,16 @@
|
||||||
Version 1.3.22 (in progress)
|
Version 1.3.22 (in progress)
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
|
05/03/2004: dancy (Ahmon Dancy)
|
||||||
|
|
||||||
|
* Lib/allegrocl/allegrocl.swg: Updated comments about identifer
|
||||||
|
conversion.
|
||||||
|
|
||||||
|
* Sources/Modules/allegorcl.cxx: Register /dev/null for "header"
|
||||||
|
target. Also, disregard "const" qualifiers during type
|
||||||
|
conversion.
|
||||||
|
|
||||||
|
|
||||||
05/02/2004: wuzzeb (John Lenz)
|
05/02/2004: wuzzeb (John Lenz)
|
||||||
[Chicken] Fix bug 782468.
|
[Chicken] Fix bug 782468.
|
||||||
To fix this bug, the runtime code has been rewritten, and
|
To fix this bug, the runtime code has been rewritten, and
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
%wrapper %{
|
%wrapper %{
|
||||||
;; allegrocl.swg
|
|
||||||
;; $Id$
|
;; $Id$
|
||||||
|
|
||||||
(eval-when (compile eval)
|
(eval-when (compile eval)
|
||||||
|
|
||||||
;; Customize this (in your swig interface definition file, not here)
|
;;; You can define your own identifier converter if you want.
|
||||||
;; if you want to change how the name is defined in Lisp. This
|
;;; Use the -identifier-converter command line argument to
|
||||||
;; function will be called at least twice per symbol, so keep this
|
;;; specify its name.
|
||||||
;; in mind if your customized function has side effects.
|
|
||||||
|
(defun identifier-convert-null (id &key type)
|
||||||
(defun identifier-convert-null (id &key type)
|
(declare (ignore type))
|
||||||
(declare (ignore type))
|
(intern id))
|
||||||
(intern id))
|
|
||||||
|
|
||||||
(defun identifier-convert-lispify (cname &key type)
|
(defun identifier-convert-lispify (cname &key type)
|
||||||
(assert (stringp cname))
|
(assert (stringp cname))
|
||||||
|
|
@ -43,5 +41,5 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
) ;; eval-when
|
) ;; eval-when
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "swigmod.h"
|
#include "swigmod.h"
|
||||||
|
|
||||||
|
;; $Id$
|
||||||
|
|
||||||
class ALLEGROCL : public Language {
|
class ALLEGROCL : public Language {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -12,6 +14,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static File *f_cl=0;
|
static File *f_cl=0;
|
||||||
|
static File *f_null=0;
|
||||||
|
|
||||||
char *identifier_converter="identifier-convert-null";
|
char *identifier_converter="identifier-convert-null";
|
||||||
|
|
||||||
|
|
@ -106,10 +109,16 @@ void add_defined_foreign_type(String *type) {
|
||||||
|
|
||||||
|
|
||||||
String *convert_type(SwigType *ty) {
|
String *convert_type(SwigType *ty) {
|
||||||
char *type_reduced=Char(SwigType_typedef_resolve_all(ty));
|
SwigType *tr=SwigType_typedef_resolve_all(ty);
|
||||||
|
char *type_reduced=Char(tr);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//Printf(stdout,"convert_type %s\n", ty);
|
//Printf(stdout,"convert_type %s\n", ty);
|
||||||
|
if (SwigType_isconst(tr)) {
|
||||||
|
SwigType_pop(tr);
|
||||||
|
type_reduced=Char(tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (SwigType_ispointer(type_reduced) || SwigType_isarray(ty) ||
|
if (SwigType_ispointer(type_reduced) || SwigType_isarray(ty) ||
|
||||||
!strncmp(type_reduced, "p.f", 3)) {
|
!strncmp(type_reduced, "p.f", 3)) {
|
||||||
|
|
@ -148,6 +157,9 @@ void ALLEGROCL :: main(int argc, char *argv[]) {
|
||||||
SWIG_library_directory("allegrocl");
|
SWIG_library_directory("allegrocl");
|
||||||
SWIG_config_file("allegrocl.swg");
|
SWIG_config_file("allegrocl.swg");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(i=1; i<argc; i++) {
|
for(i=1; i<argc; i++) {
|
||||||
if (!strcmp(argv[i], "-identifier-converter")) {
|
if (!strcmp(argv[i], "-identifier-converter")) {
|
||||||
|
|
@ -191,16 +203,26 @@ void ALLEGROCL :: main(int argc, char *argv[]) {
|
||||||
int ALLEGROCL :: top(Node *n) {
|
int ALLEGROCL :: top(Node *n) {
|
||||||
String *module=Getattr(n, "name");
|
String *module=Getattr(n, "name");
|
||||||
String *output_filename=NewString("");
|
String *output_filename=NewString("");
|
||||||
|
String *devnull=NewString("/dev/null");
|
||||||
|
|
||||||
|
f_null=NewFile(devnull, "w+");
|
||||||
|
if (!f_null) {
|
||||||
|
perror("Failed to open /dev/null");
|
||||||
|
SWIG_exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
Delete(devnull);
|
||||||
|
|
||||||
|
|
||||||
Printf(output_filename, "%s%s.cl", SWIG_output_directory(), module);
|
Printf(output_filename, "%s%s.cl", SWIG_output_directory(), module);
|
||||||
|
|
||||||
|
|
||||||
f_cl=NewFile(output_filename, "w");
|
f_cl=NewFile(output_filename, "w");
|
||||||
if (!f_cl) {
|
if (!f_cl) {
|
||||||
Printf(stderr, "Unable to open %s for writing\n", output_filename);
|
Printf(stderr, "Unable to open %s for writing\n", output_filename);
|
||||||
SWIG_exit(EXIT_FAILURE);
|
SWIG_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Swig_register_filebyname("header",f_cl);
|
Swig_register_filebyname("header",f_null);
|
||||||
Swig_register_filebyname("wrapper", f_cl);
|
Swig_register_filebyname("wrapper", f_cl);
|
||||||
|
|
||||||
Printf(f_cl, ";; This is an automatically generated file. Make changes in\n;; the definition file, not here.\n\n(defpackage :%s\n (:use :common-lisp :ff :excl))\n\n(in-package :%s)\n", module, module);
|
Printf(f_cl, ";; This is an automatically generated file. Make changes in\n;; the definition file, not here.\n\n(defpackage :%s\n (:use :common-lisp :ff :excl))\n\n(in-package :%s)\n", module, module);
|
||||||
|
|
@ -208,7 +230,9 @@ int ALLEGROCL :: top(Node *n) {
|
||||||
Language::top(n);
|
Language::top(n);
|
||||||
|
|
||||||
Close(f_cl);
|
Close(f_cl);
|
||||||
Delete(f_cl);
|
Delete(f_cl); // Delete the handle, not the file
|
||||||
|
Close(f_null);
|
||||||
|
Delete(f_null);
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue