Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <git@davidebeatrici.dev>2020-09-27 20:59:18 +0300
committerDavide Beatrici <git@davidebeatrici.dev>2020-09-27 20:59:18 +0300
commitd8c4b82efee8f2e0785f04ed8d9e7c8b24cdca4d (patch)
treeb503b8314a8cca8de00549f904c2d8bc98fba10f /plugins/CMakeLists.txt
parent6e33d349b07d26cd3ebb97067df7daa41a9b508f (diff)
FEAT(client): add several new functions to be used in positional audio plugins
- peekProcString(): reads the specified amount of data at the specified address and returns it as std::string. An empty std::string is returned in case of error. If length is 0, the function reads one byte at a time and stops when either '\0' is found or 3 seconds have passed. The successfully read data is returned, also in case of error. - peekProcVector(): can be used to read a dynamic array (size known at runtime) from the process' memory. Dynamic arrays are part of C99, which should be supported by most compilers nowadays, but std::vector provides many advantages (e.g. easy resize) over a raw array. - getVirtualFunction(): gets the address of a virtual function given its index and the class object's base address. A macro called GET_POINTER_SIZE is added because "is64Bit ? 8 : 4" is used in two places now. Also, it's useful and intuitive for plugin(s) programmers. - sinCos(): calculates sine and cosine of the specified value. On Linux the calculation is guaranteed to be simultaneous. - degreesToRadians(): converts degrees to radians. - isBigEndian(): returns whether the architecture is big-endian, by checking how a 4-byte value is stored in memory. - networkToHost() converts from network byte order to host byte order. I decided to create our own function because ntohs() is part of winsock(2).h on Windows, which means we would have to link to "ws2_32". This commit also adds and makes use of the new "OS_WINDOWS" and "OS_LINUX" definitions. The reason behind their existence is the "_WIN32" and "__linux__" definitions not being intuitive, mainly because they don't follow the same naming convention.
Diffstat (limited to 'plugins/CMakeLists.txt')
-rw-r--r--plugins/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 905cda5b4..a07fbf7fd 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -37,12 +37,17 @@ foreach(ITEM ${ITEMS})
endif()
if(WIN32)
+ target_compile_definitions(${ITEM} PRIVATE "OS_WINDOWS")
target_link_libraries(${ITEM} user32.lib)
# Shared library on Windows (e.g. ".dll")
set_target_properties(${ITEM} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
install(TARGETS ${ITEM} RUNTIME DESTINATION ./plugins COMPONENT mumble_client)
else()
+ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+ target_compile_definitions(${ITEM} PRIVATE "OS_LINUX")
+ endif()
+
# Shared library on UNIX (e.g. ".so")
set_target_properties(${ITEM} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
install(TARGETS ${ITEM} LIBRARY DESTINATION "${MUMBLE_INSTALL_LIBDIR}/plugins" COMPONENT mumble_client)