Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-345

Cannot compile NIFs for modules with dots in name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Help Wanted
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I'm trying to compile NIF with STATIC_ERLANG_NIF to use in Elixir. ERL_NIF_INIT looks like this ERL_NIF_INIT(Elixir.FastCompare, nif_funcs, NULL, NULL, NULL, NULL)MODNAME contains dot. I'm getting this when trying to compile:

      In file included from fast_compare.c:2:0:
      fast_compare.c:20:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
       ERL_NIF_INIT(Elixir.FastCompare, nif_funcs, NULL, NULL, NULL, NULL)
                          ^
      .../erts-8.2.1/include/erl_nif.h:264:51: note: in definition of macro 'ERL_NIF_INIT_DECL'
       #  define ERL_NIF_INIT_DECL(MODNAME) ErlNifEntry* MODNAME ## _nif_init(ERL_NIF_INIT_ARGS)
                                                         ^
      fast_compare.c:20:1: note: in expansion of macro 'ERL_NIF_INIT'
       ERL_NIF_INIT(Elixir.FastCompare, nif_funcs, NULL, NULL, NULL, NULL)
       ^
      fast_compare.c:20:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
       ERL_NIF_INIT(Elixir.FastCompare, nif_funcs, NULL, NULL, NULL, NULL)
                          ^
      .../erts-8.2.1/include/erl_nif.h:264:51: note: in definition of macro 'ERL_NIF_INIT_DECL'
       #  define ERL_NIF_INIT_DECL(MODNAME) ErlNifEntry* MODNAME ## _nif_init(ERL_NIF_INIT_ARGS)
                                                         ^
      fast_compare.c:20:1: note: in expansion of macro 'ERL_NIF_INIT'
       ERL_NIF_INIT(Elixir.FastCompare, nif_funcs, NULL, NULL, NULL, NULL)
       ^
      

        Attachments

          Activity

            People

            Assignee:
            sverker Sverker Eriksson
            Reporter:
            ukasiu ukasiu
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: