Skip to content

Commit 9b6c776

Browse files
committed
Problem: ZMQ-style compact streq() replaced by strcmp()==0 monstrosity
Solution: Restore the pre-Feb2018 coding pattern (ease regeneration of less dynamic projects) and retain the benefits of that patch (do not require builds with czmq headers). Signed-off-by: Jim Klimov <EvgenyKlimov@eaton.com>
1 parent 3783a83 commit 9b6c776

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

zproject_class.gsl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ $(project.GENERATED_WARNING_HEADER:)
215215

216216
#include "$(project.prefix)_classes.$(project.header_ext)"
217217

218+
#ifndef streq
219+
/*
220+
* Allow projects without czmq dependency:
221+
* The generated code expects that czmq pulls in a few headers and macro
222+
* definitions. This is a minimal fix for the generated selftest file in
223+
* C++ mode.
224+
*/
225+
#include <string.h>
226+
#define streq(s1,s2) (!strcmp ((s1), (s2)))
227+
#endif
228+
218229
typedef struct {
219230
const char *testname; // test name, can be called from command line this way
220231
void (*test) (bool); // function to run the test (or NULL for private tests)

0 commit comments

Comments
 (0)