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

size_t support? #1113

Closed
wheelerlaw opened this issue Jul 8, 2019 · 2 comments
Closed

size_t support? #1113

wheelerlaw opened this issue Jul 8, 2019 · 2 comments

Comments

@wheelerlaw
Copy link

wheelerlaw commented Jul 8, 2019

I've seen #285 and #191, this Google group post and another Google group post. size_t and ssize_t are very common types especially when making system calls in Linux.

However, I don't see any direct support for those types still in JNA. There looks to be a couple of implementations buried as nested classes, but they are not accessible since they aren't in the public scope. Why don't classes exist for these types?

@matthiasblaesing
Copy link
Member

You are right, there are multiple definitions for size_t and ssize_t in the JNA codebase, however no one stepped up yet to unify/implement them. You are wrong however, that the existing definitions are not public:

  • com.sun.jna.platform.linux.XAttr.size_t
  • com.sun.jna.platform.linux.XAttr.ssize_t
  • com.sun.jna.platform.win32.BaseTSD.SSIZE_T
  • com.sun.jna.platform.win32.BaseTSD.SIZE_T

These are all accessible. In all fairness the inline definition:

    class size_t extends IntegerType {
        public static final size_t ZERO = new size_t();

        private static final long serialVersionUID = 1L;

        public size_t() { this(0); }
        public size_t(long value) { super(Native.SIZE_T_SIZE, value, true); }
    }

is in many case just easier.

@matthiasblaesing
Copy link
Member

Fixed via d471b15

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

Successfully merging a pull request may close this issue.

2 participants