diff --git a/CMakeLists.txt b/CMakeLists.txt index 4355f98d0..967a6f004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,13 +5,18 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #include gtest 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) -add_executable(monad_native ${SOURCE_FILES}) +set(LIB_SOURCE_FILES impl/getcurrentprocessorid.cpp impl/getusername.cpp) +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) -target_link_libraries(monad_native ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(monad_native ${CMAKE_THREAD_LIBS_INIT} ps) diff --git a/impl/getusername.cpp b/impl/getusername.cpp new file mode 100644 index 000000000..b37b1cffc --- /dev/null +++ b/impl/getusername.cpp @@ -0,0 +1,8 @@ +#include "getusername.h" +#include + +BOOL GetUserName(WCHAR_T* userName, UINT32* maxLength) +{ + return 0; +} + diff --git a/impl/getusername.h b/impl/getusername.h new file mode 100644 index 000000000..922a4e96a --- /dev/null +++ b/impl/getusername.h @@ -0,0 +1,10 @@ +#pragma once + +#include "pal.h" + +PAL_BEGIN_EXTERNC + +BOOL GetUserName(WCHAR_T* userName, UINT32* maxLength); + +PAL_END_EXTERNC + diff --git a/impl/pal.h b/impl/pal.h index 659afd4f6..1cfc77630 100644 --- a/impl/pal.h +++ b/impl/pal.h @@ -51,7 +51,9 @@ #define WIN32_FROM_HRESULT(hr) hr #define HRESULT_FROM_WIN32(error) error 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 const wchar_t *PCWSTR; typedef wchar_t *PWSTR;