summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-09 11:40:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-09 11:42:58 +0000
commitc1ed005edc4e8364f4021a85e5ad1ee700d4e204 (patch)
tree6b8c0c2bb99931cee7a18810d7cc7bc860b72ba7 /solenv
parent69103eaab126ca785d248b611ad4f8ed7b6b1403 (diff)
fix oss-fuzz build
Change-Id: I22823323e0b4e15dbd6ea5f7efd35301995315bf
Diffstat (limited to 'solenv')
-rwxr-xr-xsolenv/bin/native-code.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 8bde580dda5a..e6fa5f3a2431 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -609,6 +609,7 @@ print ("""/*
*/
#include <config_features.h>
+#include <config_fuzzers.h>
#include <config_gpgme.h>
#include <osl/detail/component-mapping.h>
#include <string.h>
@@ -639,18 +640,25 @@ print ('')
for entry in sorted(custom_widgets):
print ('void make' + entry + '();')
print ('typedef void (*custom_widget_func)();')
+print ('#if !defined(ENABLE_FUZZERS)')
print ('static struct { const char *name; custom_widget_func func; } custom_widgets[] = {')
for entry in sorted(custom_widgets):
print (' { "make' + entry + '", make' + entry + ' },')
print ('};')
+print ('#endif')
print ('')
print ("""
custom_widget_func lo_get_custom_widget_func(const char* name)
{
+#if defined(ENABLE_FUZZERS)
+ (void)name;
+ return nullptr;
+#else
for (size_t i = 0; i < sizeof(custom_widgets) / sizeof(custom_widgets[0]); i++)
if (strcmp(name, custom_widgets[i].name) == 0)
return custom_widgets[i].func;
return nullptr;
+#endif
}
""")