Home | History | Annotate | Line # | Download | only in isc
      1 /*	$NetBSD: platform.h,v 1.2 2024/08/18 20:47:16 christos Exp $	*/
      2 
      3 /*
      4  * Copyright (C) 2004, 2005, 2007-2009  Internet Systems Consortium, Inc. ("ISC")
      5  * Copyright (C) 2001  Internet Software Consortium.
      6  *
      7  * Permission to use, copy, modify, and/or distribute this software for any
      8  * purpose with or without fee is hereby granted, provided that the above
      9  * copyright notice and this permission notice appear in all copies.
     10  *
     11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
     12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
     13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
     14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
     15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
     16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
     17  * PERFORMANCE OF THIS SOFTWARE.
     18  */
     19 
     20 /* Id: platform.h,v 1.19 2009/09/29 23:48:04 tbox Exp  */
     21 
     22 #ifndef ISC_PLATFORM_H
     23 #define ISC_PLATFORM_H 1
     24 
     25 /*****
     26  ***** Platform-dependent defines.
     27  *****/
     28 
     29 #define ISC_PLATFORM_USETHREADS
     30 
     31 /***
     32  *** Network.
     33  ***/
     34 
     35 #if _MSC_VER > 1200
     36 #define ISC_PLATFORM_HAVEIPV6
     37 #define ISC_PLATFORM_HAVEIN6PKTINFO
     38 #define ISC_PLATFORM_HAVESCOPEID
     39 #endif
     40 #define ISC_PLATFORM_NEEDPORTT
     41 #undef MSG_TRUNC
     42 #define ISC_PLATFORM_NEEDNTOP
     43 #define ISC_PLATFORM_NEEDPTON
     44 
     45 #ifndef ISC_PLATFORM_QUADFORMAT
     46 #define ISC_PLATFORM_QUADFORMAT "I64"
     47 #endif
     48 
     49 #define ISC_PLATFORM_NEEDSTRSEP
     50 #define ISC_PLATFORM_NEEDSTRLCPY
     51 #define ISC_PLATFORM_NEEDSTRLCAT
     52 #define ISC_PLATFORM_NEEDSTRLCPY
     53 
     54 /*
     55  * Used to control how extern data is linked; needed for Win32 platforms.
     56  */
     57 #define ISC_PLATFORM_USEDECLSPEC 1
     58 
     59 /*
     60  * Define this here for now as winsock2.h defines h_errno
     61  * and we don't want to redeclare it.
     62  */
     63 #define ISC_PLATFORM_NONSTDHERRNO
     64 
     65 /*
     66  * Define if the platform has <sys/un.h>.
     67  */
     68 #undef ISC_PLATFORM_HAVESYSUNH
     69 
     70 /*
     71  * Defines for the noreturn attribute.
     72  */
     73 #define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn)
     74 #define ISC_PLATFORM_NORETURN_POST
     75 
     76 /*
     77  * Set up a macro for importing and exporting from the DLL
     78  *
     79  * To build static libraries on win32, #define ISC_STATIC_WIN
     80  */
     81 #ifndef ISC_STATIC_WIN
     82 #define ISC_DLLEXP	__declspec(dllexport)
     83 #define ISC_DLLIMP	__declspec(dllimport)
     84 #else
     85 #define ISC_DLLEXP
     86 #define ISC_DLLIMP
     87 #endif
     88 
     89 #ifdef LIBISC_EXPORTS
     90 #define LIBISC_EXTERNAL_DATA		ISC_DLLEXP
     91 #else
     92 #define LIBISC_EXTERNAL_DATA		ISC_DLLIMP
     93 #endif
     94 
     95 #ifdef LIBISCCFG_EXPORTS
     96 #define LIBISCCFG_EXTERNAL_DATA		ISC_DLLEXP
     97 #else
     98 #define LIBISCCFG_EXTERNAL_DATA		ISC_DLLIMP
     99 #endif
    100 
    101 #ifdef LIBISCCC_EXPORTS
    102 #define LIBISCCC_EXTERNAL_DATA		ISC_DLLEXP
    103 #else
    104 #define LIBISCCC_EXTERNAL_DATA		ISC_DLLIMP
    105 #endif
    106 
    107 #ifdef LIBDNS_EXPORTS
    108 #define LIBDNS_EXTERNAL_DATA		ISC_DLLEXP
    109 #else
    110 #define LIBDNS_EXTERNAL_DATA		ISC_DLLIMP
    111 #endif
    112 
    113 #ifdef LIBBIND9_EXPORTS
    114 #define LIBBIND9_EXTERNAL_DATA		ISC_DLLEXP
    115 #else
    116 #define LIBBIND9_EXTERNAL_DATA		ISC_DLLIMP
    117 #endif
    118 
    119 #endif /* ISC_PLATFORM_H */
    120