From 0f59a997d97159ec3c5d3d900fd97d73983902e6 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 20 Sep 2022 09:10:08 +0200 Subject: Build ndpiReader and run regression tests. Signed-off-by: Toni Uhlig Signed-off-by: lns Signed-off-by: Toni Uhlig --- example/ndpiReader.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'example') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index f80bc479a..60b7f636f 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -40,7 +40,6 @@ #include #include #include -#define getopt getopt____ #else #include #include @@ -58,7 +57,9 @@ #include #include #include +#ifndef _MSC_BUILD #include +#endif #include #include "reader_util.h" @@ -4995,8 +4996,9 @@ void compressedBitmapUnitTest() { void zscoreUnitTest() { u_int32_t values[] = { 1, 3, 3, 4, 5, 2, 6, 7, 30, 16 }; u_int32_t i; - u_int32_t num_outliers, num = sizeof(values) / sizeof(u_int32_t); - bool outliers[num], do_trace = false; + u_int32_t num_outliers; + u_int32_t const num = NDPI_ARRAY_LENGTH(values); + bool outliers[NDPI_ARRAY_LENGTH(values)], do_trace = false; num_outliers = ndpi_find_outliers(values, outliers, num); @@ -5013,11 +5015,7 @@ void zscoreUnitTest() { /** @brief MAIN FUNCTION **/ -#ifdef APP_HAS_OWN_MAIN -int original_main(int argc, char **argv) { -#else int main(int argc, char **argv) { -#endif int i, skip_unit_tests = 0; #ifdef DEBUG_TRACE @@ -5125,7 +5123,14 @@ int original_main(int argc, char **argv) { return 0; } -#ifdef WIN32 +#ifdef _MSC_BUILD + int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) + { + return 0; + } +#endif + +#if defined(WIN32) && !defined(_MSC_BUILD) #ifndef __GNUC__ #define EPOCHFILETIME (116444736000000000i64) #else -- cgit v1.2.3