summaryrefslogtreecommitdiffstats
path: root/net/base/sys_addrinfo.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 00:47:37 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 00:47:37 +0000
commita540c2d2927d84f850bbe85c151e79965ae6e29b (patch)
treeb78177428ba1f731794f7c85ee41275089c6bdbe /net/base/sys_addrinfo.h
parent707904a603fe25d4f9872a9c57244a5005cf7a16 (diff)
downloadchromium_src-a540c2d2927d84f850bbe85c151e79965ae6e29b.zip
chromium_src-a540c2d2927d84f850bbe85c151e79965ae6e29b.tar.gz
chromium_src-a540c2d2927d84f850bbe85c151e79965ae6e29b.tar.bz2
Minor cleanup: add a sys_addrinfo.h header that hides the platform-specific includes needed for struct addrinfo / struct sockaddr, since we were duplicating that #if #else logic in a growing number of places.
BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/491038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/sys_addrinfo.h')
-rw-r--r--net/base/sys_addrinfo.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/base/sys_addrinfo.h b/net/base/sys_addrinfo.h
new file mode 100644
index 0000000..cfdd424
--- /dev/null
+++ b/net/base/sys_addrinfo.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This is a convenience header to pull in the platform-specific headers
+// that define at least:
+//
+// struct addrinfo
+// struct sockaddr*
+// getaddrinfo()
+// freeaddrinfo()
+// AI_*
+//
+// Prefer including this file instead of directly writing the #if / #else,
+// since it avoids duplicating the platform-specific selections.
+
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <ws2tcpip.h>
+#elif defined(OS_POSIX)
+#include <netdb.h>
+#endif
+