diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da96dac8..bc2212a64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,12 @@ if(MSVC) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}) endif() +# config.h definitions for installable headers +check_include_files(limits.h FREERDP_HAVE_LIMITS_H) +check_include_files(stdint.h FREERDP_HAVE_STDINT_H) +check_include_files(stdbool.h FREERDP_HAVE_STDBOOL_H) +check_include_files(inttypes.h FREERDP_HAVE_INTTYPES_H) + # Include files check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(unistd.h HAVE_UNISTD_H) @@ -159,6 +165,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include) # Configure files configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/freerdp/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/freerdp/config.h) # Generate pkg-config if(NOT MSVC) diff --git a/include/freerdp/config.h.in b/include/freerdp/config.h.in new file mode 100644 index 000000000..7042956aa --- /dev/null +++ b/include/freerdp/config.h.in @@ -0,0 +1,36 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * config.h definitions for installable headers + * + * Copyright 2012 Marc-Andre Moreau + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FREERDP_CONFIG_H +#define FREERDP_CONFIG_H + +/* + * This generated config.h header is meant for installation, which is why + * all definitions MUST be prefixed to avoid conflicting with third-party + * libraries. Only add configurable definitions which really must be used + * from installable headers, such as the base type definition types. + */ + +#cmakedefine FREERDP_HAVE_LIMITS_H +#cmakedefine FREERDP_HAVE_STDINT_H +#cmakedefine FREERDP_HAVE_STDBOOL_H +#cmakedefine FREERDP_HAVE_INTTYPES_H + +#endif + diff --git a/include/freerdp/types.h b/include/freerdp/types.h index 4c7afd0e5..5fa72377f 100644 --- a/include/freerdp/types.h +++ b/include/freerdp/types.h @@ -18,25 +18,24 @@ * limitations under the License. */ -#ifndef __RDP_TYPES_H -#define __RDP_TYPES_H +#ifndef FREERDP_TYPES_H +#define FREERDP_TYPES_H + +#include #ifdef _WIN32 #include #endif -/* Base Types */ -#include "config.h" - -#ifdef HAVE_LIMITS_H +#ifdef FREERDP_HAVE_LIMITS_H #include #endif -#ifdef HAVE_STDINT_H +#ifdef FREERDP_HAVE_STDINT_H #include #endif -#ifdef HAVE_INTTYPES_H +#ifdef FREERDP_HAVE_INTTYPES_H #include typedef uint8_t uint8; @@ -66,7 +65,7 @@ typedef signed long long sint64; #endif /* HAVE_INTTYPES_H */ -#ifdef HAVE_STDBOOL_H +#ifdef FREERDP_HAVE_STDBOOL_H #include @@ -108,7 +107,7 @@ typedef int boolean; #endif /* __cplusplus */ -#endif /* HAVE_STDBOOL_H */ +#endif /* FREERDP_HAVE_STDBOOL_H */ #ifndef MIN #define MIN(x,y) (((x) < (y)) ? (x) : (y))