Skip to content

Commit

Permalink
Release 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
moteus committed Nov 16, 2016
1 parent 7d169a0 commit 8a0ef50
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
41 changes: 41 additions & 0 deletions rockspec/pdh-0.1.3-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package = "pdh"
version = "0.1.3-1"

source = {
url = "https://github.com/moteus/lua-pdh/archive/v0.1.3.zip",
dir = "lua-pdh-0.1.3",
}

description = {
summary = "Lua binding to Microsoft Performance Data Helper (PDH) library",
homepage = "https://github.com/moteus/lua-pdh",
license = "MIT/X11",
maintainer = "Alexey Melnichuk",
}

supported_platforms = {
"windows"
}

dependencies = {
"lua >= 5.1, < 5.4",
}

-- WINXP SP2
local WINVER = "0x0502"

build = {
type = "builtin",
copy_directories = {"examples"},
modules = {
[ "pdh.core" ] = {
sources = {
'src/l52util.c', 'src/lpdh.c',
};
libraries = {'pdh', 'psapi', 'advapi32'};
defines = {"WINVER=" .. WINVER, "_WIN32_WINNT=" .. WINVER}
};
[ "pdh" ] = "lua/pdh.lua";
[ "pdh.psapi" ] = "lua/pdh/psapi.lua";
}
}
10 changes: 10 additions & 0 deletions src/lpdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include <Pdh.h>
#include <PdhMsg.h>

#define _LPDH_NAME "pdh"
#define _LPDH_VERSION "0.1.3"
#define _LPDH_COPYRIGHT "Copyright (C) 2013-2016 Alexey Melnichuk"
#define _LPDH_LICENSE "MIT"

#define LPDH_EXPORT __declspec(dllexport)

#define LPDH_CONCAT_STATIC_ASSERT_IMPL_(x, y) LPDH_CONCAT1_STATIC_ASSERT_IMPL_ (x, y)
Expand Down Expand Up @@ -1567,6 +1572,11 @@ LPDH_EXPORT int luaopen_pdh_core(lua_State*L){
#undef LPDH_PROCEED_CONST_NODE
#undef LPDH_PROCEED_ERROR_NODE

lua_pushliteral(L, _LPDH_NAME ); lua_setfield(L, -2, "_NAME" );
lua_pushliteral(L, _LPDH_VERSION ); lua_setfield(L, -2, "_VERSION" );
lua_pushliteral(L, _LPDH_COPYRIGHT); lua_setfield(L, -2, "_COPYRIGHT");
lua_pushliteral(L, _LPDH_LICENSE ); lua_setfield(L, -2, "_LICENSE" );

assert(top+1 == lua_gettop(L));
if(1 == luaopen_pdh_psapi(L)){
assert(top+2 == lua_gettop(L));
Expand Down

0 comments on commit 8a0ef50

Please sign in to comment.