Blame winpr/include/winpr/pack.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * WinPR: Windows Portable Runtime
Packit 1fb8d4
 * Pragma Pack
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
/**
Packit 1fb8d4
 * This header is meant to be repeatedly included
Packit 1fb8d4
 * after defining the operation to be done:
Packit 1fb8d4
 *
Packit 1fb8d4
 * #define WINPR_PACK_PUSH
Packit 1fb8d4
 * #include <winpr/pack.h> // enables packing
Packit 1fb8d4
 *
Packit 1fb8d4
 * #define WINPR_PACK_POP
Packit 1fb8d4
 * #include <winpr/pack.h> // disables packing
Packit 1fb8d4
 *
Packit 1fb8d4
 * On each include, WINPR_PACK_* macros are undefined.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#if !defined(__APPLE__)
Packit Service 5a9772
#ifndef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#define WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#endif
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH
Packit Service 5a9772
#ifndef PRAGMA_PACK_PUSH1
Packit Service 5a9772
#define PRAGMA_PACK_PUSH1
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH1
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(push, 1)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack(1)
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH1
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH2
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(push, 2)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack(2)
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH2
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH4
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(push, 4)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack(4)
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH4
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH8
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(push, 8)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack(8)
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH8
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_PUSH16
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(push, 16)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack(16)
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_PUSH16
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef PRAGMA_PACK_POP
Packit Service 5a9772
#ifdef WINPR_PRAGMA_PACK_EXT
Packit Service 5a9772
#pragma pack(pop)
Packit Service 5a9772
#else
Packit Service 5a9772
#pragma pack()
Packit Service 5a9772
#endif
Packit 1fb8d4
#undef PRAGMA_PACK_POP
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#undef WINPR_PRAGMA_PACK_EXT