Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder fails to parse declaration prefix ## name #525

Closed
luxingxiao opened this issue Nov 22, 2021 · 7 comments
Closed

Builder fails to parse declaration prefix ## name #525

luxingxiao opened this issue Nov 22, 2021 · 7 comments
Labels

Comments

@luxingxiao
Copy link

When trying to package the liquid-dsp project (https://github.com/jgaeddert/liquid-dsp)

The actual error message:

Info: Parsing liquid.h
Exception in thread "main" org.bytedeco.javacpp.tools.ParserException: liquid.h:325:"

#define LIQUID_CONCAT(prefix, name) prefix ## name": Could not parse declaration at '##'
at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:4042)
at org.bytedeco.javacpp.tools.Parser.extern(Parser.java:3941)
at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:4035)
at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:4125)
at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:4266)
at org.bytedeco.javacpp.tools.Builder.parse(Builder.java:108)
at org.bytedeco.javacpp.tools.Builder.build(Builder.java:1103)
at org.bytedeco.javacpp.tools.Builder.main(Builder.java:1450)

@saudet
Copy link
Member

saudet commented Nov 22, 2021

Please try again with JavaCPP 1.5.6 and make sure to read this page:
https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes

@luxingxiao
Copy link
Author

I have tried JavaCPP 1.5.6, but I still report this error. The following macro definition may not be supported:


#define LIQUID_CONCAT(prefix, name) prefix ## name

#define LIQUID_AGC_MANGLE_CRCF(name) LIQUID_CONCAT(agc_crcf, name)

#define LIQUID_AGC_DEFINE_API(AGC,T,TC)   \

AGC() AGC(_create)(void);                                  \

LIQUID_AGC_DEFINE_API(LIQUID_AGC_MANGLE_CRCF, float, liquid_float_complex)

@saudet
Copy link
Member

saudet commented Dec 14, 2021

I am going to need a little more context to answer this question. Could you show me all the code that you have?

@luxingxiao
Copy link
Author

luxingxiao commented Dec 17, 2021

The InforMapper class:

@Properties(inherit = javacpp.class,
    target = "org.bytedeco.liquiddsp.global.liquid",
    value = {
        @Platform(include = "liquid.h", link = "liquid")
    })
@NoException
public class liquid implements InfoMapper {

  static {
    Loader.checkVersion("org.bytedeco", "liquid-dsp");
  }

  @Override
  public void map(InfoMap infoMap) {
    infoMap.put(new Info("HAVE_FFTW3_H && !defined LIQUID_FFTOVERRIDE").define(false));
  }

}

The attachment is the header file.
liquid.h.zip

saudet added a commit that referenced this issue Dec 19, 2021
@saudet
Copy link
Member

saudet commented Dec 19, 2021

Ok, thank you! I found what the issue was. I've fixed this in commit ed47300.
Please give it a try with the snapshots: http://bytedeco.org/builds/

@luxingxiao
Copy link
Author

Ok, thank you! I found what the issue was. I've fixed this in commit ed47300. Please give it a try with the snapshots: http://bytedeco.org/builds/

Great! It is working now!

@saudet
Copy link
Member

saudet commented Feb 10, 2022

The fix has been released with JavaCPP 1.5.7. Thanks for reporting!

@saudet saudet closed this as completed Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants