usb_midi_export.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2015 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 MEDIA_MIDI_USB_MIDI_EXPORT_H_
  5. #define MEDIA_MIDI_USB_MIDI_EXPORT_H_
  6. // These files can be included as part of the midi component using the
  7. // MIDI_IMPLEMENTATION define (where we want to export in the component build),
  8. // or in the unit tests (where we never want to export/import, even in
  9. // component mode). The EXPORT_USB_MIDI define controls this.
  10. #if defined(COMPONENT_BUILD) && defined(EXPORT_USB_MIDI)
  11. #if defined(WIN32)
  12. #if defined(MIDI_IMPLEMENTATION)
  13. #define USB_MIDI_EXPORT __declspec(dllexport)
  14. #else
  15. #define USB_MIDI_EXPORT __declspec(dllimport)
  16. #endif // defined(MIDI_IMPLEMENTATION)
  17. #else // defined(WIN32)
  18. #if defined(MIDI_IMPLEMENTATION)
  19. #define USB_MIDI_EXPORT __attribute__((visibility("default")))
  20. #else
  21. #define USB_MIDI_EXPORT
  22. #endif
  23. #endif
  24. #else // defined(COMPONENT_BUILD)
  25. #define USB_MIDI_EXPORT
  26. #endif
  27. #endif // MEDIA_MIDI_USB_MIDI_EXPORT_H_