Yes. Enum values should be cleaned up a bit. I know during certain
sections initial code reviews called for such prefixing. However, I
think the logging code was done very early on.

The Windows branch also is hitting problems with these. Additionally use
of non-prefixed enums and/or macros was one aspect of Google Test that
many found problematic. So it's not a completely unique problem, but
there are ways to fix it.

On Mon, Apr 4, 2016, at 05:43 PM, ???(Uze Choi) wrote:
> As like done in Tizen platform.
> DLOG_ prefix looks best way to do.
> 
> #ifdef __TIZEN__
> typedef enum {
>     DEBUG = DLOG_DEBUG,
>     INFO = DLOG_INFO,
>     WARNING = DLOG_WARN,
>     ERROR = DLOG_ERROR,
>     FATAL = DLOG_ERROR
> } LogLevel;
> #else
> typedef enum
> {
>     DEBUG = 0, INFO, WARNING, ERROR, FATAL
> } LogLevel;
> #endif
> 
> Temporary you can switch code for iOS build as like this definition.
> However, holistic perspective duplication need to be avoid changing enum
> as like this.
> 
> BR, Uze Choi
> -----Original Message-----
> From: iotivity-dev-bounces at lists.iotivity.org
> [mailto:iotivity-dev-bounces at lists.iotivity.org] On Behalf Of Chang, Gene
> Sent: Tuesday, April 05, 2016 5:19 AM
> To: iotivity-dev at lists.iotivity.org
> Subject: [dev] Error using CSDK logger in objective-C
> 
> I am working on using iotivity for Mac and iOS and am having a compile
> problem using logger.h.  I?m trying to use the rdpayload.h headers to do
> some cbor processing in an objective-C SDK.  It looks like the problem
> I?m running into is in the LogLevel enum DEBUG declaration.
> 
> I think the problem is that on Xcode for Mac/iOS (and probably also VS
> for windows) DEBUG is already #defined and is causing a conflict in the
> global namespace for the Iotivity CSDK.  Has there been any thought to
> prefixing the enum declarations to prevent namespace conflicts?
> 
> Thanks.
> 
> Gene Chang
> Support and Enablement Lead
> Intel
> gene.chang at intel.com<mailto:gene.chang at intel.com>
> 
> This e-mail and any attachments are confidential and may be subject to
> legal or some other professional privilege. They are intended solely for
> the attention and use of the named addressee(s).
> If you are not the named addressee(s) you must not use, disclose, retain
> or reproduce all or any part of the information contained in this e-mail
> or any attachments.
> Any unauthorized use or disclosure may be unlawful. If you have received
> this e-mail by mistake, please inform the sender immediately and delete
> it and all copies from your system and destroy any hard copies of it.
> 
> _______________________________________________
> iotivity-dev mailing list
> iotivity-dev at lists.iotivity.org
> https://lists.iotivity.org/mailman/listinfo/iotivity-dev
> 
> _______________________________________________
> iotivity-dev mailing list
> iotivity-dev at lists.iotivity.org
> https://lists.iotivity.org/mailman/listinfo/iotivity-dev


-- 
  Jon A. Cruz
  jon at joncruz.org

Reply via email to