/*
 * SPDX-FileCopyrightText: 2000-2002 Copyright LifeLine Networks BV (www.lifeline.nl)
 * SPDX-FileCopyrightText: 2000-2002 Copyright Bastiaan Bakker
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_COMMON_LOG4TANGO_PORTABILITY_H
#define TANGO_COMMON_LOG4TANGO_PORTABILITY_H

#include <tango/common/defines.h>

#ifdef _MSC_VER

  // We ensure that the header is included because we will redefine the ERROR and DEBUG
  // macros. Also includes winsock2 to prevent windows.h from including 'winsock.h'.
  // clang-format off
  #include <winsock2.h>
  #include <windows.h>
  // clang-format on

  /* define to get around problems with ERROR in windows.h */
  #ifndef LOG4TANGO_FIX_ERROR_COLLISION
    #define LOG4TANGO_FIX_ERROR_COLLISION 1
  #endif

/* define mode_t */
namespace log4tango
{
typedef unsigned short mode_t;
}

  #define LOG4TANGO_UNUSED(var) var

#else // _MSC_VER
  #ifdef __GNUC__
    #define LOG4TANGO_UNUSED(var) var __attribute__((unused))
  #else
    #define LOG4TANGO_UNUSED(var) var
  #endif
#endif // _MSC_VER

#endif // TANGO_COMMON_LOG4TANGO_PORTABILITY_H
