#ifdef __cplusplus
extern "C" {
#endif
#include "lua.h"
#ifdef __cplusplus
}
#endif

#include "lualcm_lcm.h"
#include "lualcm_hash.h"
#include "lualcm_pack.h"

int luaopen_lcm_lcm(lua_State* L) {
  ll_lcm_makemetatable(L);
  ll_lcm_register_new(L);

  return 1;
}

int luaopen_lcm__hash(lua_State* L) {
  ll_hash_makemetatable(L);
  ll_hash_register_new(L);

  return 1;
}

int luaopen_lcm__pack(lua_State* L) {
  ll_pack_register(L);

  return 1;
}

#if defined(_WIN32)
__declspec(dllexport)
#elif __GNUC__ >= 4 || defined(__clang__)
__attribute__((visibility ("default")))
#endif
int luaopen_lcm(lua_State* L) {
  lua_newtable(L);

  lua_pushstring(L, "lcm");
  luaopen_lcm_lcm(L);
  lua_rawset(L, -3);

  lua_pushstring(L, "_hash");
  luaopen_lcm__hash(L);
  lua_rawset(L, -3);

  lua_pushstring(L, "_pack");
  luaopen_lcm__pack(L);
  lua_rawset(L, -3);

  return 1;
}

#ifdef __cplusplus
extern "C" {
#endif
#include "lua.h"
#ifdef __cplusplus
}
#endif

#include "lualcm_lcm.h"
#include "lualcm_hash.h"
#include "lualcm_pack.h"

int luaopen_lcm_lcm(lua_State* L) {
  ll_lcm_makemetatable(L);
  ll_lcm_register_new(L);

  return 1;
}

int luaopen_lcm__hash(lua_State* L) {
  ll_hash_makemetatable(L);
  ll_hash_register_new(L);

  return 1;
}

int luaopen_lcm__pack(lua_State* L) {
  ll_pack_register(L);

  return 1;
}

int luaopen_lcm(lua_State* L) {
  lua_newtable(L);

  lua_pushstring(L, "lcm");
  luaopen_lcm_lcm(L);
  lua_rawset(L, -3);

  lua_pushstring(L, "_hash");
  luaopen_lcm__hash(L);
  lua_rawset(L, -3);

  lua_pushstring(L, "_pack");
  luaopen_lcm__pack(L);
  lua_rawset(L, -3);

  return 1;
}

--- 
+++ 
@@ -30,6 +30,11 @@
   return 1;
 }
 
+#if defined(_WIN32)
+__declspec(dllexport)
+#elif __GNUC__ >= 4 || defined(__clang__)
+__attribute__((visibility ("default")))
+#endif
 int luaopen_lcm(lua_State* L) {
   lua_newtable(L);
 
Fix export decoration of Lua module

Add missing export decoration for Lua module entry point. This fixes the
Lua module that stopped working when ELF hidden visibility was enabled.
(I'm not sure about Windows, as I don't have Lua on Windows, but I
suspect it never worked on Windows.)
