Просмотр исходного кода

Moves 64-bit flag to CMake config

capxilinx 10 лет назад
Родитель
Сommit
eb540a446d

+ 8 - 0
source/CMakeLists.txt

@@ -31,6 +31,14 @@ set_property(CACHE OpENer_PLATFORM PROPERTY STRINGS ${OpENer_KNOWN_PLATFORMS} )
 #######################################
 INCLUDE( ${OpENer_BUILDSUPPORT_DIR}/OpENer_function_checks.cmake )
 
+#######################################
+# OpENer 64-bit data types            #
+#######################################
+set( OpENer_64_BIT_DATA_TYPES_ENABLED CACHE BOOL "Enable 64-bit data type support" )
+if( OpENer_64_BIT_DATA_TYPES_ENABLED )
+  add_definitions( -DOPENER_SUPPORT_64BIT_DATATYPES )
+endif( OpENer_64_BIT_DATA_TYPES_ENABLED )
+
 #######################################
 # OpENer tracer switches              #
 #######################################

+ 0 - 10
source/src/ports/POSIX/sample_application/opener_user_conf.h

@@ -21,14 +21,9 @@
  *    - ntohl
  *    - inet_addr
  */
-#ifdef WIN32
-#include <windows.h>
-typedef unsigned short in_port_t;
-#else
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
-#endif
 
 /** @brief Identity configuration of the device */
 #define OPENER_DEVICE_VENDOR_ID           1
@@ -156,9 +151,4 @@ static const int kOpenerProducedDataHasRunIdleHeader = 0;
  */
 #define PC_OPENER_ETHERNET_BUFFER_SIZE 512
 
-/** @brief If this define is here opener will enable 64Bit data type support.
- *
- */
-#define OPENER_SUPPORT_64BIT_DATATYPES 1
-
 #endif /*OPENER_USER_CONF_H_*/

+ 15 - 26
source/src/ports/WIN32/sample_application/opener_user_conf.h

@@ -6,8 +6,8 @@
 #ifndef OPENER_USER_CONF_H_
 #define OPENER_USER_CONF_H_
 
-/*! \file
- * \brief OpENer configuration setup
+/** @file
+ * @brief OpENer configuration setup
  * 
  * This file contains the general application specific configuration for OpENer.
  * 
@@ -21,14 +21,8 @@
  *    - ntohl
  *    - inet_addr
  */
-#ifdef WIN32
 #include <windows.h>
 typedef unsigned short in_port_t;
-#else
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#endif
 
 /*! Identity configuration of the device */
 #define OPENER_DEVICE_VENDOR_ID           1
@@ -38,7 +32,7 @@ typedef unsigned short in_port_t;
 #define OPENER_DEVICE_MINOR_REVISION      2
 #define OPENER_DEVICE_NAME      "OpENer PC"
 
-/*! Define the number of objects that may be used in connections
+/** @brief Define the number of objects that may be used in connections
  *
  *  This number needs only to consider additional objects. Connections to
  *  the connection manager object as well as to the assembly object are supported
@@ -46,52 +40,52 @@ typedef unsigned short in_port_t;
  */
 #define OPENER_CIP_NUM_APPLICATION_SPECIFIC_CONNECTABLE_OBJECTS 1
 
-/*! Define the number of supported explicit connections.
+/** @brief Define the number of supported explicit connections.
  *  According to ODVA's PUB 70 this number should be greater than 6.
  */
 #define OPENER_CIP_NUM_EXPLICIT_CONNS 6
 
-/*! Define the number of supported exclusive owner connections.
+/** @brief Define the number of supported exclusive owner connections.
  *  Each of these connections has to be configured with the function
  *  void configureExclusiveOwnerConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
  *
  */
 #define OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS 1
 
-/*! Define the number of supported input only connections.
+/** @brief Define the number of supported input only connections.
  *  Each of these connections has to be configured with the function
  *  void configureInputOnlyConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
  *
  */
 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS 1
 
-/*! Define the number of supported input only connections per connection path
+/** @brief Define the number of supported input only connections per connection path
  */
 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS_PER_CON_PATH 3
 
-/*! Define the number of supported listen only connections.
+/** @brief Define the number of supported listen only connections.
  *  Each of these connections has to be configured with the function
  *  void configureListenOnlyConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
  *
  */
 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS 1
 
-/*! Define the number of supported Listen only connections per connection path
+/** @brief Define the number of supported Listen only connections per connection path
  */
 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH   3
 
-/*! The number of bytes used for the buffer that will be used for generating any
+/** @brief The number of bytes used for the buffer that will be used for generating any
  *  reply data of messages. There are two uses in OpENer:
  *    1. Explicit messages will use this buffer to store the data generated by the request
  *    2. I/O Connections will use this buffer for the produced data
  */
 #define OPENER_MESSAGE_DATA_REPLY_BUFFER 100
 
-/*! Number of sessions that can be handled at the same time
+/** @brief Number of sessions that can be handled at the same time
  */
 #define OPENER_NUMBER_OF_SUPPORTED_SESSIONS 20
 
-/*! The time in ms of the timer used in this implementations
+/** @brief The time in ms of the timer used in this implementations
  */
 #define OPENER_TIMER_TICK 10 
 
@@ -99,7 +93,7 @@ typedef unsigned short in_port_t;
  */
 #define OPENER_CONSUMED_DATA_HAS_RUN_IDLE_HEADER 1
 
-/*! Define if RUN IDLE data is to be sent with produced data
+/** @brief Define if RUN IDLE data is to be sent with produced data
  *
  * Per default we don't send run idle headers with produced data
  */
@@ -113,7 +107,7 @@ typedef unsigned short in_port_t;
 
 /*#define PRINT_TRACE(args...)  fprintf(stderr,args);*/
 
-/*! A specialized assertion command that will log the assertion and block
+/** @brief A specialized assertion command that will log the assertion and block
  *  further execution in an while(1) loop.
  */
 #define OPENER_ASSERT(assertion) \
@@ -147,7 +141,7 @@ typedef unsigned short in_port_t;
 
 #endif
 
-/*! The number of bytes used for the Ethernet message buffer on
+/** @brief The number of bytes used for the Ethernet message buffer on
  * the pc port. For different platforms it may makes sense to 
  * have more than one buffer.
  *
@@ -156,9 +150,4 @@ typedef unsigned short in_port_t;
  */
 #define PC_OPENER_ETHERNET_BUFFER_SIZE 512
 
-/*! If this define is here opener will enable 64Bit data type support.
- *
- */
-#define OPENER_SUPPORT_64BIT_DATATYPES 1
-
 #endif /*OPENER_USER_CONF_H_*/

+ 0 - 2
source/src/typedefs.h

@@ -9,8 +9,6 @@
 #include <inttypes.h>
 #include <stddef.h>
 
-#include "opener_user_conf.h"
-
 /** @file typedefs.h
  Do not use interface types for internal variables, such as "int i;", which is
  commonly used for loop counters or counting things.