macros.h 688 B

123456789101112131415161718192021222324
  1. // Copyright 2018 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_GPU_MACROS_H_
  5. #define MEDIA_GPU_MACROS_H_
  6. #include "base/logging.h"
  7. #define DVLOGF(level) DVLOG(level) << __func__ << "(): "
  8. #define VLOGF(level) VLOG(level) << __func__ << "(): "
  9. #define VPLOGF(level) VPLOG(level) << __func__ << "(): "
  10. namespace media {
  11. // Copy the memory between arrays with checking the array size.
  12. template <typename T, size_t N>
  13. inline void SafeArrayMemcpy(T (&to)[N], const T (&from)[N]) {
  14. memcpy(to, from, sizeof(T[N]));
  15. }
  16. } // namespace media
  17. #endif // MEDIA_GPU_MACROS_H_