aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c21
1 files changed, 13 insertions, 8 deletions
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 <ws2tcpip.h>
#include <process.h>
#include <io.h>
-#define getopt getopt____
#else
#include <unistd.h>
#include <netinet/in.h>
@@ -58,7 +57,9 @@
#include <math.h>
#include <sys/stat.h>
#include <fcntl.h>
+#ifndef _MSC_BUILD
#include <libgen.h>
+#endif
#include <errno.h>
#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