Files
linuxkit/alpine/packages/llmnrd/src/compiler.h
Rolf Neugebauer 5f55666718 llmnrd: Add a LLMNR Daemon
LLMNR is the Windows equivalent of mDNS.

Import the LLMNR daemon from https://github.com/tklauser/llmnrd
It needed some small modification to compile cleanly on Moby

LLMNRD is only started when running inside a Hyper-V VM

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:10 +01:00

47 lines
1.3 KiB
C

/*
* Copyright (C) 2015 Tobias Klauser <tklauser@distanz.ch>
*
* This file is part of llmnrd.
*
* llmnrd is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 of the License.
*
* llmnrd is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with llmnrd. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COMPILER_H
#define COMPILER_H
#ifdef __GNUC__
# define __noreturn __attribute__((noreturn))
# define __warn_unused_result __attribute__((warn_unused_result))
# define __packed __attribute__((packed))
# define __unused __attribute__((unused))
# ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
# endif
#else
# define __noreturn
# define __packed
# define __unused
#endif
#ifndef offsetof
# define offsetof(type, member) ((size_t) &((type *)0)->member)
#endif
#ifndef container_of
# define container_of(ptr, type, member) ({ \
const typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member));})
#endif
#endif /* COMPILER_H */