~ubuntu-branches/debian/sid/libmpack-lua/sid

« back to all changes in this revision

Viewing changes to lmpack.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2017-07-24 23:45:39 UTC
  • Revision ID: package-import@ubuntu.com-20170724234539-up4t2bbcmeom53v5
Tags: 1.0.6-1
* Initial release after being split out from src:libmpack.
* Cherry-pick upstream patches to allow using system libs
  + Fix builds using gcc7 and/or system lua
  + Allow linking against system libmpack
* Remove -pie from DEB_BUILD_MAINT_OPTIONS, due to the new semantics.
* debian/rules: Make upstream buildsystem link against system libmpack

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
#define LUA_LIB
18
18
#include <stdlib.h>
 
19
#include <string.h>
19
20
#include <limits.h>
20
21
 
21
22
#include <lua.h>
22
23
#include <lauxlib.h>
23
24
 
24
 
#define MPACK_API static
25
 
#include "mpack-src/src/mpack.c"
 
25
#ifdef MPACK_USE_AMALGAMATION
 
26
# define MPACK_API static
 
27
# include "mpack-src/src/mpack.c"
 
28
#else
 
29
# include <mpack.h>
 
30
#endif
26
31
 
27
32
#define UNPACKER_META_NAME "mpack.Unpacker"
28
33
#define PACKER_META_NAME "mpack.Packer"
689
694
        node->tok = mpack_pack_nil();
690
695
        break;
691
696
      }
 
697
    /* Fallthrough */
692
698
    default:
693
699
      luaL_error(L, "can't serialize object");
694
700
  }