Skip to content

Commit 3bd61bf

Browse files
committed
svutil: Clean include file
* Remove MIN, MAX macros. They are unused. * Include windows.h indirectly by including host.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent e12b99d commit 3bd61bf

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/viewer/svutil.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// File: svutil.cpp
33
// Description: ScrollView Utilities
44
// Author: Joern Wanke
5-
// Created: Thu Nov 29 2007
65
//
76
// (C) Copyright 2007, Google Inc.
87
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +21,6 @@
2221

2322
#include <cstdio>
2423
#ifdef _WIN32
25-
#include <windows.h>
2624
#pragma comment(lib, "Ws2_32.lib")
2725
struct addrinfo {
2826
struct sockaddr* ai_addr;
@@ -31,6 +29,7 @@ struct addrinfo {
3129
int ai_socktype;
3230
int ai_protocol;
3331
};
32+
#include <winsock2.h> // for fd_set, send, ...
3433
#else
3534
#include <arpa/inet.h>
3635
#include <netdb.h>

src/viewer/svutil.h

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// File: svutil.h
33
// Description: ScrollView Utilities
44
// Author: Joern Wanke
5-
// Created: Thu Nov 29 2007
65
//
76
// (C) Copyright 2007, Google Inc.
87
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,23 +24,14 @@
2524
#define TESSERACT_VIEWER_SVUTIL_H_
2625

2726
#ifdef _WIN32
28-
#include <windows.h>
29-
#include "platform.h"
27+
#include "host.h" // also includes windows.h
3028
#else
3129
#include <pthread.h>
3230
#include <semaphore.h>
3331
#endif
3432

3533
#include <string>
3634

37-
#ifndef MAX
38-
#define MAX(a, b) ((a > b) ? a : b)
39-
#endif
40-
41-
#ifndef MIN
42-
#define MIN(a, b) ((a < b) ? a : b)
43-
#endif
44-
4535
/// The SVSync class provides functionality for Thread & Process Creation
4636
class SVSync {
4737
public:

0 commit comments

Comments
 (0)