added libps.so, added stub for GetUserName
This commit is contained in:
parent
0c5f78a223
commit
1b02619b2d
|
@ -5,13 +5,18 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
#include gtest
|
#include gtest
|
||||||
include_directories(../ext-src/gtest/fused-src impl)
|
include_directories(../ext-src/gtest/fused-src impl)
|
||||||
|
link_directories(${monad_native_BINARY_DIR})
|
||||||
|
|
||||||
set(SOURCE_FILES main.cpp tests/test-getcurrentprocessid.cpp impl/getcurrentprocessorid.cpp ../ext-src/gtest/fused-src/gtest/gtest-all.cc)
|
set(LIB_SOURCE_FILES impl/getcurrentprocessorid.cpp impl/getusername.cpp)
|
||||||
add_executable(monad_native ${SOURCE_FILES})
|
set(TEST_SOURCE_FILES tests/test-getcurrentprocessid.cpp)
|
||||||
|
set(SOURCE_FILES main.cpp ../ext-src/gtest/fused-src/gtest/gtest-all.cc)
|
||||||
|
|
||||||
# add pthread
|
add_library(ps SHARED ${LIB_SOURCE_FILES})
|
||||||
|
add_executable(monad_native ${SOURCE_FILES} ${TEST_SOURCE_FILES})
|
||||||
|
|
||||||
|
# add pthread and other libs
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
target_link_libraries(monad_native ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(monad_native ${CMAKE_THREAD_LIBS_INIT} ps)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
8
impl/getusername.cpp
Normal file
8
impl/getusername.cpp
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include "getusername.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
BOOL GetUserName(WCHAR_T* userName, UINT32* maxLength)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
10
impl/getusername.h
Normal file
10
impl/getusername.h
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "pal.h"
|
||||||
|
|
||||||
|
PAL_BEGIN_EXTERNC
|
||||||
|
|
||||||
|
BOOL GetUserName(WCHAR_T* userName, UINT32* maxLength);
|
||||||
|
|
||||||
|
PAL_END_EXTERNC
|
||||||
|
|
|
@ -51,7 +51,9 @@
|
||||||
#define WIN32_FROM_HRESULT(hr) hr
|
#define WIN32_FROM_HRESULT(hr) hr
|
||||||
#define HRESULT_FROM_WIN32(error) error
|
#define HRESULT_FROM_WIN32(error) error
|
||||||
typedef unsigned long DWORD, *LPDWORD;
|
typedef unsigned long DWORD, *LPDWORD;
|
||||||
typedef int BOOL;
|
typedef char BOOL;
|
||||||
|
typedef unsigned short WCHAR_T;
|
||||||
|
typedef unsigned int UINT32;
|
||||||
typedef unsigned long HRESULT;
|
typedef unsigned long HRESULT;
|
||||||
typedef const wchar_t *PCWSTR;
|
typedef const wchar_t *PCWSTR;
|
||||||
typedef wchar_t *PWSTR;
|
typedef wchar_t *PWSTR;
|
||||||
|
|
Loading…
Reference in a new issue