mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 01:37:56 +08:00
Problem: needless use of macros
Solution: convert streq/strneq into functions
This commit is contained in:
parent
a62e9d35be
commit
d0c4402daf
@ -29,6 +29,8 @@
|
||||
#include "testutil.hpp"
|
||||
#include "testutil_unity.hpp"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
const char *SEQ_END = (const char *) 1;
|
||||
|
||||
const char bounce_content[] = "12345678ABCDEFGH12345678abcdefgh";
|
||||
@ -345,3 +347,13 @@ sockaddr_in bind_bsd_socket (int socket)
|
||||
|
||||
return saddr;
|
||||
}
|
||||
|
||||
bool streq (const char *lhs, const char *rhs)
|
||||
{
|
||||
return strcmp (lhs, rhs) == 0;
|
||||
}
|
||||
|
||||
bool strneq (const char *lhs, const char *rhs)
|
||||
{
|
||||
return strcmp (lhs, rhs) != 0;
|
||||
}
|
||||
|
@ -150,8 +150,8 @@ int s_send (void *socket_, const char *string_);
|
||||
// Sends string as 0MQ string, as multipart non-terminal
|
||||
int s_sendmore (void *socket_, const char *string_);
|
||||
|
||||
#define streq(s1, s2) (!strcmp ((s1), (s2)))
|
||||
#define strneq(s1, s2) (strcmp ((s1), (s2)))
|
||||
bool streq (const char *lhs, const char *rhs);
|
||||
bool strneq (const char *lhs, const char *rhs);
|
||||
|
||||
extern const char *SEQ_END;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user