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

Declaration specifier expected near 'ssize_t' #10

Closed
demyanovs opened this issue Jul 27, 2018 · 3 comments
Closed

Declaration specifier expected near 'ssize_t' #10

demyanovs opened this issue Jul 27, 2018 · 3 comments

Comments

@demyanovs
Copy link

demyanovs commented Jul 27, 2018

Hi,
When I include file "local geo = require 'resty.maxminddb'" I get an error:
lua entry thread aborted: runtime error: .../resty_modules/lualib/resty/maxminddb.lua:115: declaration specifier expected near 'ssize_t' at line 73

It seems that should be typedef ssize_t in case if it is not declared.
When I declare ssize_t as long or size_t, the error disappears.

My lua version: 5.1

@anjia0532
Copy link
Owner

@demyanovs thanks for your report.
it works for me(ubuntu).

paste your env plz.

os version: e.g. cat /etc/os-release
openresty version: e.g. openresty -V
maxmind/libmaxminddb version: e.g. mmdblookup --version

https://github.com/maxmind/libmaxminddb/blob/cc7b880263813fbb09b3e62b8b7f9e6e4444eb28/include/maxminddb.h#L37

#define ssize_t SSIZE_T

https://github.com/maxmind/libmaxminddb/blob/cc7b880263813fbb09b3e62b8b7f9e6e4444eb28/include/maxminddb.h#L177-L190

typedef struct MMDB_s {
    uint32_t flags;
    const char *filename;
    ssize_t file_size;
    const uint8_t *file_content;
    const uint8_t *data_section;
    uint32_t data_section_size;
    const uint8_t *metadata_section;
    uint32_t metadata_section_size;
    uint16_t full_record_byte_size;
    uint16_t depth;
    MMDB_ipv4_start_node_s ipv4_start_node;
    MMDB_metadata_s metadata;
} MMDB_s;

@demyanovs
Copy link
Author

This error occurred when I ran lua without openresty, so the error is probably on my side.

@anjia0532
Copy link
Owner

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants