net_export.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_BASE_NET_EXPORT_H_
  5. #define NET_BASE_NET_EXPORT_H_
  6. // Defines NET_EXPORT so that functionality implemented by the net module can
  7. // be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to
  8. // access features not intended to be used directly by real consumers.
  9. #if defined(COMPONENT_BUILD)
  10. #if defined(WIN32)
  11. #if defined(NET_IMPLEMENTATION)
  12. #define NET_EXPORT __declspec(dllexport)
  13. #define NET_EXPORT_PRIVATE __declspec(dllexport)
  14. #else
  15. #define NET_EXPORT __declspec(dllimport)
  16. #define NET_EXPORT_PRIVATE __declspec(dllimport)
  17. #endif // defined(NET_IMPLEMENTATION)
  18. #else // defined(WIN32)
  19. #if defined(NET_IMPLEMENTATION)
  20. #define NET_EXPORT __attribute__((visibility("default")))
  21. #define NET_EXPORT_PRIVATE __attribute__((visibility("default")))
  22. #else
  23. #define NET_EXPORT
  24. #define NET_EXPORT_PRIVATE
  25. #endif
  26. #endif
  27. #else /// defined(COMPONENT_BUILD)
  28. #define NET_EXPORT
  29. #define NET_EXPORT_PRIVATE
  30. #endif
  31. #endif // NET_BASE_NET_EXPORT_H_