Thread (132 messages) 132 messages, 13 authors, 2021-04-29

Re: [dpdk-dev] [PATCH v2 1/7] eal: add wrappers for POSIX string functions

From: Nick Connolly <hidden>
Date: 2021-02-22 18:21:24

For any functions, such as strdup, which are not in a public header I would
suggest the following as a possible start point, based off what was done
for strlcpy.

* In DPDK (probably EAL), define an rte_strdup function for use as a
   fallback.
* Inside the meson build scripts, use "cc.has_function()" to check if the
   regular strdup function is available. If not, then add "-DRTE_NO_STRDUP"
   to the c_args for DPDK building
* Inside our DPDK header (rte_string_fns.h in the strdup case), we can add
   a conditional define such as:
    #ifdef RTE_NO_STRDUP
    #define strdup(s) rte_strdup(s)
    #endif

Thoughts on this?
Looks like an elegant approach to me.
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help