{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/rocksdb/issues/3305","repository_url":"https://api.github.com/repos/facebook/rocksdb","labels_url":"https://api.github.com/repos/facebook/rocksdb/issues/3305/labels{/name}","comments_url":"https://api.github.com/repos/facebook/rocksdb/issues/3305/comments","events_url":"https://api.github.com/repos/facebook/rocksdb/issues/3305/events","html_url":"https://github.com/facebook/rocksdb/issues/3305","id":284193567,"node_id":"MDU6SXNzdWUyODQxOTM1Njc=","number":3305,"title":"Making it work for those poor NetBSD users out there: max_align_t","user":{"login":"zilti","id":661984,"node_id":"MDQ6VXNlcjY2MTk4NA==","avatar_url":"https://avatars2.githubusercontent.com/u/661984?v=4","gravatar_id":"","url":"https://api.github.com/users/zilti","html_url":"https://github.com/zilti","followers_url":"https://api.github.com/users/zilti/followers","following_url":"https://api.github.com/users/zilti/following{/other_user}","gists_url":"https://api.github.com/users/zilti/gists{/gist_id}","starred_url":"https://api.github.com/users/zilti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilti/subscriptions","organizations_url":"https://api.github.com/users/zilti/orgs","repos_url":"https://api.github.com/users/zilti/repos","events_url":"https://api.github.com/users/zilti/events{/privacy}","received_events_url":"https://api.github.com/users/zilti/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-22T15:48:04Z","updated_at":"2018-06-22T17:02:48Z","closed_at":"2018-06-22T17:02:48Z","author_association":"NONE","body":"Hi! This is mostly a heads-up. I tried to compile it on NetBSD and stumbled over `max_align_t`. used in util/arena.h. The solution is to add this to the util/arena.h file:\r\n\r\n```c\r\n/* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is\r\n   a hack in case the configure-time test was done with g++ even though\r\n   we are currently compiling with gcc.  */\r\n#if ! (0 || defined _GCC_MAX_ALIGN_T)\r\n/* On the x86, the maximum storage alignment of double, long, etc. is 4,\r\n   but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,\r\n   and the C11 standard allows this.  Work around this problem by\r\n   using __alignof__ (which returns 8 for double) rather than _Alignof\r\n   (which returns 4), and align each union member accordingly.  */\r\n# ifdef __GNUC__\r\n#  define _GL_STDDEF_ALIGNAS(type) \\\r\n     __attribute__ ((__aligned__ (__alignof__ (type))))\r\n# else\r\n#  define _GL_STDDEF_ALIGNAS(type) /* */\r\n# endif\r\ntypedef union\r\n{\r\n  char *__p _GL_STDDEF_ALIGNAS (char *);\r\n  double __d _GL_STDDEF_ALIGNAS (double);\r\n  long double __ld _GL_STDDEF_ALIGNAS (long double);\r\n  long int __i _GL_STDDEF_ALIGNAS (long int);\r\n} max_align_t;\r\n#endif\r\n```\r\n\r\nsomewhere before the reference to `max_align_t`. Feel free to copy this snippet into your code and use it under your license; no need to mention me anywhere. I don't claim any rights on it."},"comment":{"url":"https://api.github.com/repos/facebook/rocksdb/issues/comments/399512080","html_url":"https://github.com/facebook/rocksdb/issues/3305#issuecomment-399512080","issue_url":"https://api.github.com/repos/facebook/rocksdb/issues/3305","id":399512080,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTUxMjA4MA==","user":{"login":"gfosco","id":406732,"node_id":"MDQ6VXNlcjQwNjczMg==","avatar_url":"https://avatars2.githubusercontent.com/u/406732?v=4","gravatar_id":"","url":"https://api.github.com/users/gfosco","html_url":"https://github.com/gfosco","followers_url":"https://api.github.com/users/gfosco/followers","following_url":"https://api.github.com/users/gfosco/following{/other_user}","gists_url":"https://api.github.com/users/gfosco/gists{/gist_id}","starred_url":"https://api.github.com/users/gfosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfosco/subscriptions","organizations_url":"https://api.github.com/users/gfosco/orgs","repos_url":"https://api.github.com/users/gfosco/repos","events_url":"https://api.github.com/users/gfosco/events{/privacy}","received_events_url":"https://api.github.com/users/gfosco/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T17:02:48Z","updated_at":"2018-06-22T17:02:48Z","author_association":"CONTRIBUTOR","body":"If you'd like to get this update in, please send a PR.  Thanks!"}}
{"actor":{"display_login":"gfosco"}}