Skip to content

Commit

Permalink
Remove DLL_LOCAL macro
Browse files Browse the repository at this point in the history
This macro doesn't appear to be providing any value, and make some
compilation harder.
  • Loading branch information
mwswartwout committed Mar 8, 2023
1 parent e4326be commit 4c154b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/lib/support/DLLUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@

#if defined _WIN32 || defined __CYGWIN__
#define DLL_EXPORT __declspec(dllexport)
#define DLL_LOCAL
#else
#if __GNUC__ >= 4
#define DLL_EXPORT __attribute__((visibility("default")))
#define DLL_LOCAL __attribute__((visibility("hidden")))
#else
#define DLL_EXPORT
#define DLL_LOCAL
#endif
#endif
10 changes: 5 additions & 5 deletions src/lib/support/logging/CHIPLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ DLL_EXPORT void SetLogFilter(uint8_t category);
static constexpr uint16_t kMaxModuleNameLen = 3;

#if CHIP_LOG_FILTERING
DLL_LOCAL bool IsCategoryEnabled(uint8_t category);
bool IsCategoryEnabled(uint8_t category);
#else // CHIP_LOG_FILTERING
DLL_LOCAL inline bool IsCategoryEnabled(uint8_t category)
inline bool IsCategoryEnabled(uint8_t category)
{
return true;
}
Expand Down Expand Up @@ -395,9 +395,9 @@ DLL_LOCAL inline bool IsCategoryEnabled(uint8_t category)
#define _IsModuleCategoryEnabled3(DUMMY_ARG, GLOB_CAT) _IsModuleCategoryEnabled4(DUMMY_ARG 0, GLOB_CAT)
#define _IsModuleCategoryEnabled4(ARG1, ARG2, ...) (ARG2)

DLL_LOCAL void Log(uint8_t module, uint8_t category, const char * msg, ...) ENFORCE_FORMAT(3, 4);
DLL_LOCAL void LogByteSpan(uint8_t module, uint8_t category, const ByteSpan & span);
DLL_LOCAL void LogV(uint8_t module, uint8_t category, const char * msg, va_list args) ENFORCE_FORMAT(3, 0);
void Log(uint8_t module, uint8_t category, const char * msg, ...) ENFORCE_FORMAT(3, 4);
void LogByteSpan(uint8_t module, uint8_t category, const ByteSpan & span);
void LogV(uint8_t module, uint8_t category, const char * msg, va_list args) ENFORCE_FORMAT(3, 0);

#if CHIP_SYSTEM_CONFIG_PLATFORM_LOG
#ifndef ChipPlatformLog
Expand Down
9 changes: 4 additions & 5 deletions src/platform/Darwin/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#pragma once

#include <lib/support/DLLUtil.h>
#include <lib/support/logging/Constants.h>

#include <os/log.h>
Expand Down Expand Up @@ -65,18 +64,18 @@ enum OSLogCategory
kOSLogCategory_AUTOMATION = OS_LOG_TYPE_DEFAULT,
};

DLL_LOCAL os_log_t LoggerForModule(chip::Logging::LogModule moduleId, char const * moduleName);
DLL_LOCAL void LogByteSpan(chip::Logging::LogModule moduleId, char const * moduleName, os_log_type_t type,
os_log_t LoggerForModule(chip::Logging::LogModule moduleId, char const * moduleName);
void LogByteSpan(chip::Logging::LogModule moduleId, char const * moduleName, os_log_type_t type,
const chip::ByteSpan & span);

// Helper constructs for compile-time validation of format strings for C++ / ObjC++ contexts.
// Note that ObjC++ contexts are restricted to NSString style specifiers. Supporting os_log()
// specifiers would require these to be emulated or stripped when log redirection is used.
#ifdef __OBJC__
DLL_LOCAL bool ValidateLogFormat(NSString * format, ...) __attribute__((format(__NSString__, 1, 0))); // not implemented
bool ValidateLogFormat(NSString * format, ...) __attribute__((format(__NSString__, 1, 0))); // not implemented
#define ChipPlatformValidateLogFormat(F, ...) ((void) sizeof(chip::Logging::Platform::ValidateLogFormat(@F, ##__VA_ARGS__)))
#else // __OBJC__
DLL_LOCAL bool ValidateLogFormat(char const * format, ...) __attribute__((format(printf, 1, 0))); // not implemented
bool ValidateLogFormat(char const * format, ...) __attribute__((format(printf, 1, 0))); // not implemented
#define ChipPlatformValidateLogFormat(F, ...) ((void) sizeof(chip::Logging::Platform::ValidateLogFormat(F, ##__VA_ARGS__)))
#endif // __OBJC__

Expand Down

0 comments on commit 4c154b4

Please sign in to comment.