dom/camera/CameraCommon.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
michael@0 2 /* vim: set ts=2 et sw=2 tw=40: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef DOM_CAMERA_CAMERACOMMON_H
michael@0 8 #define DOM_CAMERA_CAMERACOMMON_H
michael@0 9
michael@0 10 #ifndef __func__
michael@0 11 #ifdef __FUNCTION__
michael@0 12 #define __func__ __FUNCTION__
michael@0 13 #else
michael@0 14 #define __func__ __FILE__
michael@0 15 #endif
michael@0 16 #endif
michael@0 17
michael@0 18 #ifndef NAN
michael@0 19 #define NAN std::numeric_limits<double>::quiet_NaN()
michael@0 20 #endif
michael@0 21
michael@0 22 #include "prlog.h"
michael@0 23
michael@0 24 #ifdef PR_LOGGING
michael@0 25 extern PRLogModuleInfo* GetCameraLog();
michael@0 26 #define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
michael@0 27 #else
michael@0 28 #define DOM_CAMERA_LOG( type, ... )
michael@0 29 #endif
michael@0 30
michael@0 31 #define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
michael@0 32
michael@0 33 /**
michael@0 34 * From the least to the most output.
michael@0 35 */
michael@0 36 enum {
michael@0 37 DOM_CAMERA_LOG_NOTHING,
michael@0 38 DOM_CAMERA_LOG_ERROR,
michael@0 39 DOM_CAMERA_LOG_WARNING,
michael@0 40 DOM_CAMERA_LOG_INFO,
michael@0 41 DOM_CAMERA_LOG_TRACE,
michael@0 42 DOM_CAMERA_LOG_REFERENCES
michael@0 43 };
michael@0 44
michael@0 45 /**
michael@0 46 * DOM_CAMERA_LOGR() can be called before 'gCameraLog' is set, so
michael@0 47 * we need to handle this one a little differently.
michael@0 48 */
michael@0 49 #ifdef PR_LOGGING
michael@0 50 #define DOM_CAMERA_LOGR( ... ) \
michael@0 51 do { \
michael@0 52 if (GetCameraLog()) { \
michael@0 53 DOM_CAMERA_LOG( DOM_CAMERA_LOG_REFERENCES, __VA_ARGS__ ); \
michael@0 54 } \
michael@0 55 } while (0)
michael@0 56 #else
michael@0 57 #define DOM_CAMERA_LOGR( ... )
michael@0 58 #endif
michael@0 59 #define DOM_CAMERA_LOGT( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_TRACE, __VA_ARGS__ )
michael@0 60 #define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ )
michael@0 61 #define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ )
michael@0 62 #define DOM_CAMERA_LOGE( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_ERROR, __VA_ARGS__ )
michael@0 63
michael@0 64 #endif // DOM_CAMERA_CAMERACOMMON_H

mercurial