~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Source/Modules/ocaml.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-06 10:27:08 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206102708-t37t62i45n595w0e
Tags: 1.3.33-2ubuntu1
* Merge with Debian; remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - Clean Runtime/ as well.
  - Force a few environment variables.
* debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Ocaml language module for SWIG.
8
8
 * ----------------------------------------------------------------------------- */
9
9
 
10
 
char cvsroot_ocaml_cxx[] = "$Header: /cvsroot/swig/SWIG/Source/Modules/ocaml.cxx,v 1.78 2006/11/09 22:32:28 wsfulton Exp $";
 
10
char cvsroot_ocaml_cxx[] = "$Id: ocaml.cxx 10003 2007-10-17 21:42:11Z wsfulton $";
11
11
 
12
12
#include "swigmod.h"
13
13
 
75
75
  }
76
76
 
77
77
  void PrintIncludeArg() {
78
 
    Printv(stdout, SWIG_LIB, SWIG_FILE_DELIMETER, ocaml_path, "\n", NIL);
 
78
    Printv(stdout, SWIG_LIB, SWIG_FILE_DELIMITER, ocaml_path, "\n", NIL);
79
79
  }
80
80
 
81
81
  /* ------------------------------------------------------------
311
311
    Printf(f_int_to_enum, "let _ = Callback.register \"%s_int_to_enum\" int_to_enum\n", module);
312
312
    Printf(f_mlibody, "val int_to_enum : c_enum_type -> int -> c_obj\n");
313
313
    Printf(f_init, "#define SWIG_init f_%s_init\n" "%s" "}\n", module, init_func_def);
314
 
    Printf(f_mlbody, "external f_init : unit -> unit = \"f_%s_init\" ;;\n" "let _ = f_init ()\n", module, module);
 
314
    Printf(f_mlbody, "external f_init : unit -> unit = \"f_%s_init\" ;;\n" "let _ = f_init ()\n", module);
315
315
    Printf(f_enumtypes_type, "]\n");
316
316
    Printf(f_enumtypes_value, "]\n\n" "type c_obj = c_enum_value c_obj_t\n");
317
317
 
446
446
    if (isOverloaded) {
447
447
      overname = Getattr(n, "sym:overname");
448
448
    } else {
449
 
      if (!addSymbol(iname, n))
 
449
      if (!addSymbol(iname, n)) {
 
450
        DelWrapper(f);
450
451
        return SWIG_ERROR;
 
452
      }
451
453
    }
452
454
    if (overname) {
453
455
      Append(wname, overname);
469
471
    } else if (classmode && in_destructor) {
470
472
      Printf(f_class_ctors, "    \"~\", %s ;\n", mangled_name);
471
473
    } else if (classmode && !in_constructor && !in_destructor && !static_member_function) {
472
 
      String *opname = Copy(Getattr(n, "name"));
 
474
      String *opname = Copy(Getattr(n, "memberfunctionHandler:sym:name"));
473
475
 
474
476
      Replaceall(opname, "operator ", "");
475
477
 
1094
1096
 
1095
1097
  int classHandler(Node *n) {
1096
1098
    String *name = Getattr(n, "name");
 
1099
 
 
1100
    if (!name)
 
1101
      return SWIG_OK;
 
1102
 
1097
1103
    String *mangled_sym_name = mangleNameForCaml(name);
1098
1104
    String *this_class_def = NewString(f_classtemplate);
1099
1105
    String *name_normalized = normalizeTemplatedClassName(name);
1102
1108
    f_class_ctors = NewString("");
1103
1109
    bool sizeof_feature = generate_sizeof && isSimpleType(name);
1104
1110
 
1105
 
    if (!name)
1106
 
      return SWIG_OK;
1107
1111
 
1108
1112
    classname = mangled_sym_name;
1109
1113
    classmode = true;