diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2014-03-07 10:54:54 -0800 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2014-03-07 10:54:54 -0800 |
commit | 0bb63c7420e31fbb91b94df473d3c046260a1fcc (patch) | |
tree | 907289ed145ab542e4f2d701c11c11f386a1bfe5 /volk/lib | |
parent | f08f0f2b0ed69d98e18ec631a71af9ea6791f2e2 (diff) | |
parent | 1e0c15b7df7bca6c3a20efb22db0713b8d75675d (diff) |
Merge remote-tracking branch 'ncorgan/master_win_compat'
Diffstat (limited to 'volk/lib')
-rw-r--r-- | volk/lib/CMakeLists.txt | 19 | ||||
-rw-r--r-- | volk/lib/volk_malloc.c | 4 |
2 files changed, 20 insertions, 3 deletions
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index dbebac067f..d2e4e62212 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2011-2012 Free Software Foundation, Inc. +# Copyright 2011-2012,2014 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -308,8 +308,21 @@ STRING(TOUPPER ${CMAKE_BUILD_TYPE} CBTU) MESSAGE(STATUS BUILT TYPE ${CBTU}) MESSAGE(STATUS "Base cflags = ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS}") set(COMPILER_INFO "") -execute_process(COMMAND ${CMAKE_C_COMPILER} --version - OUTPUT_VARIABLE cmake_c_compiler_version) +IF(MSVC) + IF(MSVC90) #Visual Studio 9 + SET(cmake_c_compiler_version "Microsoft Visual Studio 9.0") + ELSE(MSVC10) #Visual Studio 10 + SET(cmake_c_compiler_version "Microsoft Visual Studio 10.0") + ELSE(MSVC11) #Visual Studio 11 + SET(cmake_c_compiler_version "Microsoft Visual Studio 11.0") + ELSE(MSVC12) #Visual Studio 12 + SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0") + ENDIF() +ELSE() + execute_process(COMMAND ${CMAKE_C_COMPILER} --version + OUTPUT_VARIABLE cmake_c_compiler_version) +ENDIF(MSVC) +set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n" ) foreach(machine_name ${available_machines}) #generate machine source diff --git a/volk/lib/volk_malloc.c b/volk/lib/volk_malloc.c index 1333345800..65cb5eb8e9 100644 --- a/volk/lib/volk_malloc.c +++ b/volk/lib/volk_malloc.c @@ -111,7 +111,11 @@ volk_malloc(size_t size, size_t alignment) // Find and return the first aligned boundary of the pointer void *aptr = ptr; if((unsigned long)ptr % alignment != 0) +#ifdef _MSC_VER + aptr = (void*)((unsigned long)ptr + (alignment - ((unsigned long)ptr % alignment))); +#else aptr = ptr + (alignment - ((unsigned long)ptr % alignment)); +#endif // Store original pointer and aligned pointers mbuf *n = (mbuf*)malloc(sizeof(mbuf)); |