Remove unnecessary CMake modules and fixup os/CMakeLists.txt
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
		
							parent
							
								
									1990007614
								
							
						
					
					
						commit
						e25656a4c5
					
				
					 39 changed files with 406 additions and 210 deletions
				
			
		| 
						 | 
				
			
			@ -9,8 +9,6 @@
 | 
			
		|||
#
 | 
			
		||||
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
 | 
			
		||||
#
 | 
			
		||||
find_package(Abstraction REQUIRED)
 | 
			
		||||
 | 
			
		||||
include (GenerateExportHeader)
 | 
			
		||||
 | 
			
		||||
FUNCTION(PREPEND var prefix)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -537,8 +537,8 @@ dds_get_status_mask(
 | 
			
		|||
        _Out_ uint32_t *mask);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_(entity & DDS_ENTITY_KIND_MASK)
 | 
			
		||||
DDS_EXPORT _Check_return_ dds_return_t
 | 
			
		||||
DDS_DEPRECATED_EXPORT dds_get_enabled_status(
 | 
			
		||||
DDS_DEPRECATED_EXPORT _Check_return_ dds_return_t
 | 
			
		||||
dds_get_enabled_status(
 | 
			
		||||
        _In_  dds_entity_t entity,
 | 
			
		||||
        _Out_ uint32_t *mask);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -568,8 +568,7 @@ dds_set_status_mask(
 | 
			
		|||
        _In_ uint32_t mask);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_(entity & DDS_ENTITY_KIND_MASK)
 | 
			
		||||
DDS_EXPORT dds_return_t
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
DDS_DEPRECATED_EXPORT dds_return_t
 | 
			
		||||
dds_set_enabled_status(
 | 
			
		||||
        _In_ dds_entity_t entity,
 | 
			
		||||
        _In_ uint32_t mask);
 | 
			
		||||
| 
						 | 
				
			
			@ -1115,8 +1114,7 @@ dds_set_topic_filter(
 | 
			
		|||
        dds_topic_filter_fn filter);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT void
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
DDS_DEPRECATED_EXPORT void
 | 
			
		||||
dds_topic_set_filter(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
        dds_topic_filter_fn filter);
 | 
			
		||||
| 
						 | 
				
			
			@ -1134,8 +1132,7 @@ dds_get_topic_filter(
 | 
			
		|||
        dds_entity_t topic);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT dds_topic_filter_fn
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
DDS_DEPRECATED_EXPORT dds_topic_filter_fn
 | 
			
		||||
dds_topic_get_filter(
 | 
			
		||||
        dds_entity_t topic);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3145,8 +3142,7 @@ dds_lookup_instance(
 | 
			
		|||
        const void *data);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_(entity & DDS_ENTITY_KIND_MASK)
 | 
			
		||||
DDS_EXPORT dds_instance_handle_t
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
DDS_DEPRECATED_EXPORT dds_instance_handle_t
 | 
			
		||||
dds_instance_lookup (
 | 
			
		||||
        dds_entity_t entity,
 | 
			
		||||
        const void *data);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -533,7 +533,6 @@ void dds_qset_partition
 | 
			
		|||
)
 | 
			
		||||
{
 | 
			
		||||
    uint32_t i;
 | 
			
		||||
    size_t len;
 | 
			
		||||
 | 
			
		||||
    if(!qos) {
 | 
			
		||||
        DDS_ERROR("Argument qos may not be NULL\n");
 | 
			
		||||
| 
						 | 
				
			
			@ -558,9 +557,7 @@ void dds_qset_partition
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < n; i++) {
 | 
			
		||||
        len = strlen (ps[i]) + 1;
 | 
			
		||||
        qos->partition.strs[i] = dds_alloc (len);
 | 
			
		||||
        strncpy (qos->partition.strs[i], ps[i], len);
 | 
			
		||||
        qos->partition.strs[i] = dds_string_dup (ps[i]);
 | 
			
		||||
    }
 | 
			
		||||
    qos->present |= QP_PARTITION;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -458,6 +458,7 @@ dds_create_topic(
 | 
			
		|||
    nn_plist_t plist;
 | 
			
		||||
    dds_entity_t hdl;
 | 
			
		||||
    uint32_t index;
 | 
			
		||||
    size_t keysz;
 | 
			
		||||
 | 
			
		||||
    if (desc == NULL){
 | 
			
		||||
        DDS_ERROR("Topic description is NULL");
 | 
			
		||||
| 
						 | 
				
			
			@ -478,10 +479,9 @@ dds_create_topic(
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    typename = desc->m_typename;
 | 
			
		||||
    key = (char*) dds_alloc (strlen (name) + strlen (typename) + 2);
 | 
			
		||||
    strcpy (key, name);
 | 
			
		||||
    strcat (key, "/");
 | 
			
		||||
    strcat (key, typename);
 | 
			
		||||
    keysz = strlen (name) + strlen (typename) + 2;
 | 
			
		||||
    key = (char*) dds_alloc (keysz);
 | 
			
		||||
    (void) snprintf(key, keysz, "%s/%s", name, typename);
 | 
			
		||||
 | 
			
		||||
    st = dds_alloc (sizeof (*st));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -490,10 +490,8 @@ dds_create_topic(
 | 
			
		|||
    st->c.status_cb = dds_topic_status_cb;
 | 
			
		||||
    st->c.status_cb_entity = NULL; /* set by dds_create_topic_arbitrary */
 | 
			
		||||
    st->c.name_typename = key;
 | 
			
		||||
    st->c.name = dds_alloc (strlen (name) + 1);
 | 
			
		||||
    strcpy (st->c.name, name);
 | 
			
		||||
    st->c.typename = dds_alloc (strlen (typename) + 1);
 | 
			
		||||
    strcpy (st->c.typename, typename);
 | 
			
		||||
    st->c.name = dds_string_dup (name);
 | 
			
		||||
    st->c.typename = dds_string_dup (typename);
 | 
			
		||||
    st->c.ops = &ddsi_sertopic_ops_default;
 | 
			
		||||
    st->c.serdata_ops = desc->m_nkeys ? &ddsi_serdata_ops_cdr : &ddsi_serdata_ops_cdr_nokey;
 | 
			
		||||
    st->c.serdata_basehash = ddsi_sertopic_compute_serdata_basehash (st->c.serdata_ops);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,9 +45,10 @@ static void config__check_env(
 | 
			
		|||
        if ( !env_ok ) {
 | 
			
		||||
            os_result r;
 | 
			
		||||
            char *envstr;
 | 
			
		||||
            size_t len = strlen(env_variable) + strlen("=") + strlen(expected_value) + 1;
 | 
			
		||||
 | 
			
		||||
            envstr = os_malloc(strlen(env_variable) + strlen("=") + strlen(expected_value) + 1);
 | 
			
		||||
            (void) sprintf(envstr, "%s=%s", env_variable, expected_value);
 | 
			
		||||
            envstr = os_malloc(len);
 | 
			
		||||
            (void)snprintf(envstr, len, "%s=%s", env_variable, expected_value);
 | 
			
		||||
 | 
			
		||||
            r = os_putenv(envstr);
 | 
			
		||||
            CU_ASSERT_EQUAL_FATAL(r, os_resultSuccess);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,12 +85,12 @@ CU_Test(ddsc_participant, create_with_conf_no_env) {
 | 
			
		|||
    dds_domainid_t valid_domain=3;
 | 
			
		||||
 | 
			
		||||
    static char env_uri_str[1000];
 | 
			
		||||
    (void) sprintf(env_uri_str, "%s=%s", DDSC_PROJECT_NAME_NOSPACE_CAPS"_URI", CONFIG_ENV_SIMPLE_UDP);
 | 
			
		||||
    (void) snprintf(env_uri_str, sizeof(env_uri_str), "%s=%s", DDSC_PROJECT_NAME_NOSPACE_CAPS"_URI", CONFIG_ENV_SIMPLE_UDP);
 | 
			
		||||
    os_putenv(env_uri_str);
 | 
			
		||||
    printf("env_uri_str %s\n", env_uri_str);
 | 
			
		||||
 | 
			
		||||
    static char env_mp_str[100];
 | 
			
		||||
    (void) sprintf(env_mp_str, "%s=%s", "MAX_PARTICIPANTS", CONFIG_ENV_MAX_PARTICIPANTS);
 | 
			
		||||
    (void) snprintf(env_mp_str, sizeof(env_mp_str), "%s=%s", "MAX_PARTICIPANTS", CONFIG_ENV_MAX_PARTICIPANTS);
 | 
			
		||||
    os_putenv(env_mp_str);
 | 
			
		||||
 | 
			
		||||
    const char * env_uri = os_getenv(DDSC_PROJECT_NAME_NOSPACE_CAPS"_URI");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -128,16 +128,15 @@ static int unreg_group_membership (struct nn_group_membership *mship, ddsi_tran_
 | 
			
		|||
 | 
			
		||||
static char *make_joinleave_msg (char *buf, size_t bufsz, ddsi_tran_conn_t conn, int join, const nn_locator_t *srcloc, const nn_locator_t *mcloc, const struct nn_interface *interf, int err)
 | 
			
		||||
{
 | 
			
		||||
  char mcstr[DDSI_LOCSTRLEN], srcstr[DDSI_LOCSTRLEN], interfstr[DDSI_LOCSTRLEN];
 | 
			
		||||
  char mcstr[DDSI_LOCSTRLEN], interfstr[DDSI_LOCSTRLEN];
 | 
			
		||||
  char srcstr[DDSI_LOCSTRLEN] = { '*', '\0' };
 | 
			
		||||
  int n;
 | 
			
		||||
#ifdef DDSI_INCLUDE_SSM
 | 
			
		||||
  if (srcloc)
 | 
			
		||||
  if (srcloc) {
 | 
			
		||||
    ddsi_locator_to_string_no_port(srcstr, sizeof(srcstr), srcloc);
 | 
			
		||||
  else
 | 
			
		||||
    strcpy (srcstr, "*");
 | 
			
		||||
  }
 | 
			
		||||
#else
 | 
			
		||||
  OS_UNUSED_ARG (srcloc);
 | 
			
		||||
  strcpy (srcstr, "*");
 | 
			
		||||
#endif
 | 
			
		||||
  ddsi_locator_to_string_no_port (mcstr, sizeof(mcstr), mcloc);
 | 
			
		||||
  if (interf)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -125,6 +125,7 @@ static int add_addresses_to_addrset_1 (struct addrset *as, const char *ip, int p
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
int add_addresses_to_addrset (struct addrset *as, const char *addrs, int port_mode, const char *msgtag, int req_mc)
 | 
			
		||||
{
 | 
			
		||||
  /* port_mode: -1  => take from string, if 0 & unicast, add for a range of participant indices;
 | 
			
		||||
| 
						 | 
				
			
			@ -177,6 +178,7 @@ int add_addresses_to_addrset (struct addrset *as, const char *addrs, int port_mo
 | 
			
		|||
  os_free (addrs_copy);
 | 
			
		||||
  return retval;
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
int compare_locators (const nn_locator_t *a, const nn_locator_t *b)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1473,6 +1473,7 @@ static int uf_string(struct cfgst *cfgst, void *parent, struct cfgelem const * c
 | 
			
		|||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
static int uf_natint64_unit(struct cfgst *cfgst, int64_t *elem, const char *value, const struct unit *unittab, int64_t def_mult, int64_t max)
 | 
			
		||||
{
 | 
			
		||||
    int pos;
 | 
			
		||||
| 
						 | 
				
			
			@ -1502,6 +1503,7 @@ static int uf_natint64_unit(struct cfgst *cfgst, int64_t *elem, const char *valu
 | 
			
		|||
        return cfg_error(cfgst, "%s: invalid value", value);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
#ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING
 | 
			
		||||
static int uf_bandwidth(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value)
 | 
			
		||||
| 
						 | 
				
			
			@ -1761,6 +1763,7 @@ static void pf_sched_class(struct cfgst *cfgst, void *parent, struct cfgelem con
 | 
			
		|||
    cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : "");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
static int uf_maybe_int32(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value)
 | 
			
		||||
{
 | 
			
		||||
    struct config_maybe_int32 *elem = cfg_address(cfgst, parent, cfgelem);
 | 
			
		||||
| 
						 | 
				
			
			@ -1776,6 +1779,7 @@ static int uf_maybe_int32(struct cfgst *cfgst, void *parent, struct cfgelem cons
 | 
			
		|||
        return cfg_error(cfgst, "'%s': neither 'default' nor a decimal integer\n", value);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
static int uf_maybe_memsize(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -1902,6 +1906,7 @@ static int uf_int_min_max(struct cfgst *cfgst, void *parent, struct cfgelem cons
 | 
			
		|||
        return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
static int uf_domainId(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value)
 | 
			
		||||
{
 | 
			
		||||
  struct config_maybe_int32 *elem = cfg_address(cfgst, parent, cfgelem);
 | 
			
		||||
| 
						 | 
				
			
			@ -1917,6 +1922,7 @@ static int uf_domainId(struct cfgst *cfgst, void *parent, struct cfgelem const *
 | 
			
		|||
    return cfg_error(cfgst, "'%s': neither 'any' nor a decimal integer in 0 .. 230\n", value);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
static int uf_participantIndex(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -2745,6 +2751,7 @@ struct cfgst * config_init
 | 
			
		|||
            struct ut_xmlpState *qx;
 | 
			
		||||
            FILE *fp;
 | 
			
		||||
 | 
			
		||||
            OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
            if ( (fp = fopen(tok, "r")) == NULL ) {
 | 
			
		||||
                if ( strncmp(tok, "file://", 7) != 0 || (fp = fopen(tok + 7, "r")) == NULL ) {
 | 
			
		||||
                    DDS_ERROR("can't open configuration file %s\n", tok);
 | 
			
		||||
| 
						 | 
				
			
			@ -2753,6 +2760,7 @@ struct cfgst * config_init
 | 
			
		|||
                    return NULL;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
            cb.attr = proc_attr;
 | 
			
		||||
            cb.elem_close = proc_elem_close;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -426,6 +426,7 @@ static int check_thread_properties (void)
 | 
			
		|||
  return ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
int rtps_config_open (void)
 | 
			
		||||
{
 | 
			
		||||
    int status;
 | 
			
		||||
| 
						 | 
				
			
			@ -462,6 +463,7 @@ int rtps_config_open (void)
 | 
			
		|||
 | 
			
		||||
    return status;
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
int rtps_config_prep (struct cfgst *cfgst)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -481,12 +481,11 @@ int find_own_ip (const char *requested_address)
 | 
			
		|||
    char if_name[sizeof (last_if_name)];
 | 
			
		||||
    int q = 0;
 | 
			
		||||
 | 
			
		||||
    strncpy (if_name, ifa->name, sizeof (if_name) - 1);
 | 
			
		||||
    if_name[sizeof (if_name) - 1] = 0;
 | 
			
		||||
    os_strlcpy(if_name, ifa->name, sizeof(if_name));
 | 
			
		||||
 | 
			
		||||
    if (strcmp (if_name, last_if_name))
 | 
			
		||||
      DDS_LOG(DDS_LC_CONFIG, "%s%s", sep, if_name);
 | 
			
		||||
    strcpy (last_if_name, if_name);
 | 
			
		||||
    os_strlcpy(last_if_name, if_name, sizeof(last_if_name));
 | 
			
		||||
 | 
			
		||||
    /* interface must be up */
 | 
			
		||||
    if ((ifa->flags & IFF_UP) == 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,6 +79,7 @@ static const ipv4_hdr_t ipv4_hdr_template = {
 | 
			
		|||
#define IPV4_HDR_SIZE 20
 | 
			
		||||
#define UDP_HDR_SIZE 8
 | 
			
		||||
 | 
			
		||||
OS_WARNING_MSVC_OFF(4996);
 | 
			
		||||
FILE *new_pcap_file (const char *name)
 | 
			
		||||
{
 | 
			
		||||
  FILE *fp;
 | 
			
		||||
| 
						 | 
				
			
			@ -101,6 +102,7 @@ FILE *new_pcap_file (const char *name)
 | 
			
		|||
 | 
			
		||||
  return fp;
 | 
			
		||||
}
 | 
			
		||||
OS_WARNING_MSVC_ON(4996);
 | 
			
		||||
 | 
			
		||||
static void write_data (FILE *fp, const struct msghdr *msghdr, size_t sz)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2509,6 +2509,7 @@ struct nn_dqueue *nn_dqueue_new (const char *name, uint32_t max_samples, nn_dque
 | 
			
		|||
{
 | 
			
		||||
  struct nn_dqueue *q;
 | 
			
		||||
  char *thrname;
 | 
			
		||||
  size_t thrnamesz;
 | 
			
		||||
 | 
			
		||||
  if ((q = os_malloc (sizeof (*q))) == NULL)
 | 
			
		||||
    goto fail_q;
 | 
			
		||||
| 
						 | 
				
			
			@ -2523,9 +2524,10 @@ struct nn_dqueue *nn_dqueue_new (const char *name, uint32_t max_samples, nn_dque
 | 
			
		|||
  os_mutexInit (&q->lock);
 | 
			
		||||
  os_condInit (&q->cond, &q->lock);
 | 
			
		||||
 | 
			
		||||
  if ((thrname = os_malloc (3 + strlen (name) + 1)) == NULL)
 | 
			
		||||
  thrnamesz = 3 + strlen (name) + 1;
 | 
			
		||||
  if ((thrname = os_malloc (thrnamesz)) == NULL)
 | 
			
		||||
    goto fail_thrname;
 | 
			
		||||
  sprintf (thrname, "dq.%s", name);
 | 
			
		||||
  snprintf (thrname, thrnamesz, "dq.%s", name);
 | 
			
		||||
  if ((q->ts = create_thread (thrname, (uint32_t (*) (void *)) dqueue_thread, q)) == NULL)
 | 
			
		||||
    goto fail_thread;
 | 
			
		||||
  os_free (thrname);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue