unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Mambo Levis <mambo.levis@gmail.com>
To: Mambo Levis <mambo.levis@gmail.com>,
	 "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	 "johnw@newartisans.com" <johnw@newartisans.com>,
	 "bozhidar@batsov.com" <bozhidar@batsov.com>
Subject: Re: Emacs modules 25.1
Date: Tue, 27 Sep 2016 12:23:08 +0000 (UTC)	[thread overview]
Message-ID: <1273225869.1442197.1474978988432@mail.yahoo.com> (raw)
In-Reply-To: <709716874.935191.1474913256978@mail.yahoo.com>

Hi,
I found the problem and now I can build the emacs_module example using g++.
That's means that I eventually can create a c++ wrapper, but I would like to listen to your advice because I don't knowif there is a fundamental issue that I'm ignoring. So, only one question is still open?
1. Is it possible to create a C++ wrapper around emacs_modules and what are the implications?


Thanks,
Levis

 

    On Monday, September 26, 2016 8:07 PM, Mambo Levis <mambo.levis@gmail.com> wrote:
 

 Hi,
I tested (in Windows) the example from Aurélien Aptel (http://diobla.info/blog-archive/modules-tut.html) with gcc at it runs as expected.
Now, I would like to create a C++ wrapper, but I not quite sure if it is possible. Questions:
1. Is it possible to create a C++ wrapper around emacs_modules?2. I am trying to build the same example using g++ and the following error appears:
---------------------------------------------------------------------------------------------------------------$ make SO=dllg++ -ggdb3 -ID:\user\emacs-src\emacs-25-branch-src/src -c mymod.cmymod.c: In function 'int emacs_module_init(emacs_runtime*)':mymod.c:55:45: error: invalid conversion from 'emacs_value_tag* (*)(emacs_env*, int, emacs_value_tag**, void*) {aka emacs_value_tag* (*)(emacs_env_25*, int, emacs_value_tag**, void*)}' to 'emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*) {aka emacs_value_tag* (*)(emacs_env_25*, long long int, emacs_value_tag**, void*)}' [-fpermissive]                                         NULL);                                             ^Makefile:42: recipe for target 'mymod.o' failedmake: *** [mymod.o] Error 1
---------------------------------------------------------------------------------------------------------------
It corresponds to the following code (I remarked the part associated with the error)
-------------------------------------------------------------------------------------------------------intemacs_module_init (struct emacs_runtime *ert){  emacs_env *env = ert->get_environment (ert);
  /* create a lambda (returns an emacs_value) */  emacs_value fun = env->make_function (env,                                        0,                                        0,                                        Fmymod_test,                                        "doc",                                        NULL);  bind_function (env, "mymod-test", fun);  provide (env, "mymod");
/* loaded successfully */  return 0;}
-----------------------------------------------------------------------------------------------------------
Do you have any Idea or recommendation? 
Thanks,
Levis




   


  reply	other threads:[~2016-09-27 12:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <709716874.935191.1474913256978.ref@mail.yahoo.com>
2016-09-26 18:07 ` Emacs modules 25.1 Mambo Levis
2016-09-27 12:23   ` Mambo Levis [this message]
2016-09-27 14:55     ` Eli Zaretskii
2016-09-27 15:36     ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273225869.1442197.1474978988432@mail.yahoo.com \
    --to=mambo.levis@gmail.com \
    --cc=bozhidar@batsov.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=johnw@newartisans.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).