Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DLL_LOCAL and DLL_IMPORT #25577

Merged
merged 4 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/lib/support/DLLUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@
#pragma once

#if defined _WIN32 || defined __CYGWIN__
#define DLL_IMPORT __declspec(dllimport)
#define DLL_EXPORT __declspec(dllexport)
#define DLL_LOCAL
#else
#if __GNUC__ >= 4
#define DLL_IMPORT __attribute__((visibility("default")))
#define DLL_EXPORT __attribute__((visibility("default")))
#define DLL_LOCAL __attribute__((visibility("hidden")))
#else
#define DLL_IMPORT
#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
10 changes: 4 additions & 6 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,17 @@ enum OSLogCategory
kOSLogCategory_AUTOMATION = OS_LOG_TYPE_DEFAULT,
};

DLL_LOCAL os_log_t LoggerForModule(chip::Logging::LogModule moduleId, char const * moduleName);
ksperling-apple marked this conversation as resolved.
Show resolved Hide resolved
DLL_LOCAL void LogByteSpan(chip::Logging::LogModule moduleId, char const * moduleName, os_log_type_t type,
const chip::ByteSpan & span);
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