libfreerdp-primitives: fix build on Windows

This commit is contained in:
Marc-André Moreau 2013-01-18 20:47:18 -05:00
parent 3df754e0bb
commit ce5e52ba6f
6 changed files with 54 additions and 42 deletions

View File

@ -502,7 +502,7 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 1) {\
printf("%s: error reading %s\n", __func__, #TARGET); \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_BYTE(s, TARGET); \
@ -514,7 +514,7 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 2) { \
printf("%s: error reading %s or %s\n", __func__, #TARGET1, #TARGET2); \
printf("%s: error reading %s or %s\n", __FUNCTION__, #TARGET1, #TARGET2); \
return FALSE; \
} \
stream_read_BYTE(s, TARGET1); \
@ -527,7 +527,7 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 2) { \
printf("%s: error reading %s\n", __func__, #TARGET); \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_UINT16(s, TARGET); \
@ -538,7 +538,7 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 4) { \
printf("%s: error reading %s\n", __func__, #TARGET); \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_UINT32(s, TARGET); \
@ -548,14 +548,14 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
#define ORDER_FIELD_COORD(NO, TARGET) \
do { \
if ((orderInfo->fieldFlags & (1 << (NO-1))) && !update_read_coord(s, &TARGET, orderInfo->deltaCoordinates)) { \
printf("%s: error reading %s\n", __func__, #TARGET); \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
} while(0)
#define ORDER_FIELD_COLOR(NO, TARGET) \
do { \
if ((orderInfo->fieldFlags & (1 << (NO-1))) && !update_read_color(s, &TARGET)) { \
printf("%s: error reading %s\n", __func__, #TARGET); \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
} while(0)
@ -564,12 +564,12 @@ static INLINE BOOL update_read_delta_points(STREAM* s, DELTA_POINT* points, int
#define FIELD_SKIP_BUFFER16(s, TARGET_LEN) \
do { \
if (stream_get_left(s) < 2) {\
printf("%s: error reading length %s\n", __func__, #TARGET_LEN); \
printf("%s: error reading length %s\n", __FUNCTION__, #TARGET_LEN); \
return FALSE; \
}\
stream_read_UINT16(s, TARGET_LEN); \
if (!stream_skip(s, TARGET_LEN)) { \
printf("%s: error skipping %d bytes\n", __func__, TARGET_LEN); \
printf("%s: error skipping %d bytes\n", __FUNCTION__, TARGET_LEN); \
return FALSE; \
} \
} while(0)

View File

@ -13,24 +13,20 @@
# and limitations under the License.
#
set(FREERDP_PRIMITIVE_CFILES
prim_add.c
prim_andor.c
prim_alphaComp.c
prim_colors.c
prim_copy.c
prim_set.c
prim_shift.c
prim_sign.c
set(MODULE_NAME "freerdp-primitives")
set(MODULE_PREFIX "FREERDP_PRIMITIVES")
set(${MODULE_PREFIX}_SRCS
prim_add.c
prim_andor.c
prim_alphaComp.c
prim_colors.c
prim_copy.c
prim_set.c
prim_shift.c
prim_sign.c
primitives.c
)
set(FREERDP_PRIMITIVE_HEADERS
prim_internal.h
)
set(FREERDP_PRIMITIVE_SRCS
${FREERDP_PRIMITIVE_CFILES}
${FREERDP_PRIMITIVE_HEADERS}
)
prim_internal.h)
add_definitions(-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
@ -53,29 +49,28 @@ if(WITH_SSE2)
endif()
elseif(WITH_NEON)
if(CMAKE_COMPILER_IS_GNUCC)
set(OPTIMZATION "${OPTIMIZATION} -mfpu=neon -mfloat-abi=softfp")
set(OPTIMIZATION "${OPTIMIZATION} -mfpu=neon -mfloat-abi=softfp")
endif()
# TODO: Add MSVC equivalent
endif()
set_property(SOURCE ${FREERDP_PRIMITIVE_CFILES} PROPERTY COMPILE_FLAGS ${OPTIMIZATION})
if(WITH_MONOLITHIC_BUILD)
add_library(freerdp-primitives OBJECT ${FREERDP_PRIMITIVE_SRCS})
set_property(SOURCE ${${MODULE_PREFIX}_SRCS} PROPERTY COMPILE_FLAGS ${OPTIMIZATION})
add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
MONOLITHIC ${MONOLITHIC_BUILD}
SOURCES ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
if(MONOLITHIC_BUILD)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
else()
add_library(freerdp-primitives ${FREERDP_PRIMITIVE_SRCS})
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
set_target_properties(freerdp-primitives PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
#set(FREERDP_PRIMITIVE_LIBS, rt)
if(WITH_MONOLITHIC_BUILD)
set(FREERDP_LIBS ${FREERDP_LIBS} ${FREERDP_PRIMITIVE_LIBS} PARENT_SCOPE)
else()
target_link_libraries(freerdp-primitives ${FREERDP_PRIMITIVE_LIBS})
install(TARGETS freerdp-primitives DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(BUILD_TESTING)
if(BUILD_TESTING AND (NOT WIN32))
add_subdirectory(test)
endif(BUILD_TESTING)
endif()

View File

@ -137,3 +137,5 @@ if(NOT TESTING_OUTPUT_DIRECTORY)
set(TESTING_OUTPUT_DIRECTORY .)
endif()
add_test(prim_test ${TESTING_OUTPUT_DIRECTORY}/prim_test functionality)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/Test")

View File

@ -30,7 +30,11 @@
#define __MEASURE_H_INCLUDED__
#include <time.h>
#ifndef _WIN32
#include <sys/param.h>
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -12,11 +12,20 @@
* permissions and limitations under the License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "prim_test.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#include <time.h>

View File

@ -27,7 +27,9 @@
#include <measure.h>
#include <string.h>
#include <stdio.h>
#include <freerdp/primitives.h>
#ifdef WITH_IPP
#include <ipps.h>
#include <ippi.h>