Formatted WV utils/include files.
[ Merge of http://go/wvgerrit/80943 ] Ran `git clang-format` on files in utils/include. Used the new .clang-format config. Bug: 134365840 Test: WV unit tests Change-Id: Ifc0950236ecd610792e9add11ac07c63485f3f0c
This commit is contained in:
@@ -11,7 +11,6 @@ namespace wvcdm {
|
|||||||
TypeName(const TypeName&); \
|
TypeName(const TypeName&); \
|
||||||
void operator=(const TypeName&)
|
void operator=(const TypeName&)
|
||||||
|
|
||||||
|
|
||||||
} // namespace wvcdm
|
} // namespace wvcdm
|
||||||
|
|
||||||
#endif // WVCDM_UTIL_DISALLOW_COPY_AND_ASSIGN_H_
|
#endif // WVCDM_UTIL_DISALLOW_COPY_AND_ASSIGN_H_
|
||||||
|
|||||||
@@ -33,22 +33,21 @@ extern LogPriority g_cutoff;
|
|||||||
// unit tests.
|
// unit tests.
|
||||||
CORE_UTIL_EXPORT void InitLogging();
|
CORE_UTIL_EXPORT void InitLogging();
|
||||||
|
|
||||||
CORE_UTIL_EXPORT void Log(
|
CORE_UTIL_EXPORT void Log(const char* file, const char* function, int line,
|
||||||
const char* file, const char* function, int line, LogPriority level,
|
LogPriority level, const char* fmt, ...);
|
||||||
const char* fmt, ...);
|
|
||||||
|
|
||||||
// Log APIs
|
// Log APIs
|
||||||
#ifndef LOGE
|
#ifndef LOGE
|
||||||
#define LOGE(...) Log(__FILE__, __func__, __LINE__, \
|
# define LOGE(...) \
|
||||||
wvcdm::LOG_ERROR, __VA_ARGS__)
|
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_ERROR, __VA_ARGS__)
|
||||||
#define LOGW(...) Log(__FILE__, __func__, __LINE__, \
|
# define LOGW(...) \
|
||||||
wvcdm::LOG_WARN, __VA_ARGS__)
|
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_WARN, __VA_ARGS__)
|
||||||
#define LOGI(...) Log(__FILE__, __func__, __LINE__, \
|
# define LOGI(...) \
|
||||||
wvcdm::LOG_INFO, __VA_ARGS__)
|
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_INFO, __VA_ARGS__)
|
||||||
#define LOGD(...) Log(__FILE__, __func__, __LINE__, \
|
# define LOGD(...) \
|
||||||
wvcdm::LOG_DEBUG, __VA_ARGS__)
|
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_DEBUG, __VA_ARGS__)
|
||||||
#define LOGV(...) Log(__FILE__, __func__, __LINE__, \
|
# define LOGV(...) \
|
||||||
wvcdm::LOG_VERBOSE, __VA_ARGS__)
|
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_VERBOSE, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
} // namespace wvcdm
|
} // namespace wvcdm
|
||||||
|
|
||||||
|
|||||||
@@ -10,24 +10,22 @@
|
|||||||
#include "util_common.h"
|
#include "util_common.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <wtypes.h>
|
# include <BaseTsd.h>
|
||||||
# include <BaseTsd.h>
|
# include <winsock2.h> // For htonl and ntohl.
|
||||||
# include <winsock2.h> // For htonl and ntohl.
|
# include <wtypes.h>
|
||||||
# define __PRETTY_FUNCTION__ __FUNCTION__
|
# define __PRETTY_FUNCTION__ __FUNCTION__
|
||||||
# undef NO_ERROR
|
# undef NO_ERROR
|
||||||
# undef GetCurrentTime
|
# undef GetCurrentTime
|
||||||
# undef DeleteFile
|
# undef DeleteFile
|
||||||
|
|
||||||
using ssize_t = SSIZE_T;
|
using ssize_t = SSIZE_T;
|
||||||
|
|
||||||
inline void sleep(int seconds) {
|
inline void sleep(int seconds) { Sleep(seconds * 1000); }
|
||||||
Sleep(seconds * 1000);
|
|
||||||
}
|
|
||||||
CORE_UTIL_EXPORT int setenv(const char* key, const char* value, int overwrite);
|
CORE_UTIL_EXPORT int setenv(const char* key, const char* value, int overwrite);
|
||||||
#else
|
#else
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // WVCDM_UTIL_PLATFORM_H_
|
#endif // WVCDM_UTIL_PLATFORM_H_
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,17 @@
|
|||||||
#define WVCDM_UTIL_UTIL_COMMON_H_
|
#define WVCDM_UTIL_UTIL_COMMON_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifdef CORE_UTIL_IMPLEMENTATION
|
# ifdef CORE_UTIL_IMPLEMENTATION
|
||||||
# define CORE_UTIL_EXPORT __declspec(dllexport)
|
# define CORE_UTIL_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define CORE_UTIL_EXPORT __declspec(dllimport)
|
# define CORE_UTIL_EXPORT __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CORE_UTIL_IMPLEMENTATION
|
# ifdef CORE_UTIL_IMPLEMENTATION
|
||||||
# define CORE_UTIL_EXPORT __attribute__((visibility("default")))
|
# define CORE_UTIL_EXPORT __attribute__((visibility("default")))
|
||||||
# else
|
# else
|
||||||
# define CORE_UTIL_EXPORT
|
# define CORE_UTIL_EXPORT
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // WVCDM_UTIL_UTIL_COMMON_H_
|
#endif // WVCDM_UTIL_UTIL_COMMON_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user