Use config.h instead of -DHAVE_FOO=1

swiftc(1) requires every -D option to be prefixed with -Xcc, which
is not easy to achieve using autoconf.

Now instead of setting configuration macros like HAVE_LSEEK64 on the
command line using -D, they are defined in config.h, which is generated
by ./configure, ignored by Git, and included by all headers and source
files that use any configuration macro.

The dependency on Makefile has been replaced with a dependency on
Makefile.in and config.h, which helps avoid some redundant full
recompiles after running ./configure, because the configure script
does not overwrit config.h if its content does not change.
This commit is contained in:
Andrew Bettison 2016-10-19 16:27:20 +10:30
parent 42f62d2b8b
commit 1efe6686fc
27 changed files with 395 additions and 32 deletions

15
.gitignore vendored
View File

@ -10,14 +10,15 @@
*.a *.a
*.suo *.suo
.*.sw? .*.sw?
VERSION.txt /VERSION.txt
/configure /configure
/autom4te.cache /autom4te.cache
/aclocal.m4 /aclocal.m4
Makefile /config.log
testconfig.sh /config.status
config.log /Makefile
config.status /testconfig.sh
/config.h
/nacl/nacl-20110221/build /nacl/nacl-20110221/build
/nacl/naclinc.txt /nacl/naclinc.txt
/nacl/nacllib.txt /nacl/nacllib.txt
@ -31,6 +32,6 @@ config.status
/simulator /simulator
*.so *.so
test.*.log test.*.log
/testlog /testlog/
/coverage_html /coverage_html/
*.info *.info

View File

@ -227,13 +227,13 @@ $(OBJSDIR_LIB)/%.o: $(SOURCE_PREFIX)%.c
# broad so it sometimes results in unnecessary re-compilation, but that is # broad so it sometimes results in unnecessary re-compilation, but that is
# better than too narrow, which can result in missed re-compilation. # better than too narrow, which can result in missed re-compilation.
$(SERVAL_DAEMON_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) $(SERVAL_DAEMON_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS)
$(SERVALD_OBJS): $(SOURCE_PREFIX)Makefile $(SERVALD_OBJS): $(SOURCE_PREFIX)Makefile.in
$(LIB_SERVAL_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) $(LIB_SERVAL_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS)
$(OBJSDIR_TOOLS)/tfw_createfile.o: $(SOURCE_PREFIX)Makefile $(SOURCE_PREFIX)str.h $(OBJSDIR_TOOLS)/tfw_createfile.o: $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)str.h
$(OBJSDIR_TOOLS)/directory_service.o: $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) $(OBJSDIR_TOOLS)/directory_service.o: $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS)
$(MONITOR_CLIENT_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) $(MONITOR_CLIENT_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS)
$(SIMULATOR_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) $(SIMULATOR_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS)
# Rules for main targets. # Rules for main targets.

View File

@ -18,6 +18,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h> // for PRId64 #include <inttypes.h> // for PRId64
#include "cli_stdio.h" #include "cli_stdio.h"

268
config.h.in Normal file
View File

@ -0,0 +1,268 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if the acosf() function is available. */
#undef HAVE_ACOSF
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if the asinf() function is available. */
#undef HAVE_ASINF
/* Define to 1 if the atan2f() function is available. */
#undef HAVE_ATAN2F
/* Define to 1 if the atanf() function is available. */
#undef HAVE_ATANF
/* Define to 1 if you have the `bcmp' function. */
#undef HAVE_BCMP
/* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO
/* Define to 1 if the ceilf() function is available. */
#undef HAVE_CEILF
/* Define to 1 if the cosf() function is available. */
#undef HAVE_COSF
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if the expf() function is available. */
#undef HAVE_EXPF
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define to 1 if the floorf() function is available. */
#undef HAVE_FLOORF
/* Define to 1 if the system has the `aligned' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_ALIGNED
/* Define to 1 if the system has the `alloc_size' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_ALLOC_SIZE
/* Define to 1 if the system has the `error' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_ERROR
/* Define to 1 if the system has the `format' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_FORMAT
/* Define to 1 if the system has the `malloc' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_MALLOC
/* Define to 1 if the system has the `unused' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_UNUSED
/* Define to 1 if the system has the `used' function attribute */
#undef HAVE_FUNC_ATTRIBUTE_USED
/* Define to 1 if you have the `getpeereid' function. */
#undef HAVE_GETPEEREID
/* Define to 1 if you have the `gettid' function. */
#undef HAVE_GETTID
/* Define to 1 if you have the <ifaddrs.h> header file. */
#undef HAVE_IFADDRS_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <jni.h> header file. */
#undef HAVE_JNI_H
/* Define to 1 if you have the `c' library (-lc). */
#undef HAVE_LIBC
/* Define to 1 if you have the `rt' library (-lrt). */
#undef HAVE_LIBRT
/* Define to 1 if you have the `sodium' library (-lsodium). */
#undef HAVE_LIBSODIUM
/* Define to 1 if you have the <linux/if.h> header file. */
#undef HAVE_LINUX_IF_H
/* Define to 1 if you have the <linux/ioctl.h> header file. */
#undef HAVE_LINUX_IOCTL_H
/* Define to 1 if you have the <linux/netlink.h> header file. */
#undef HAVE_LINUX_NETLINK_H
/* Define to 1 if you have the <linux/rtnetlink.h> header file. */
#undef HAVE_LINUX_RTNETLINK_H
/* Linux threads are supported - gettid(2) and tgkill(2). */
#undef HAVE_LINUX_THREADS
/* Define to 1 if the log10f() function is available. */
#undef HAVE_LOG10F
/* Define to 1 if the logf() function is available. */
#undef HAVE_LOGF
/* Define to 1 if you have the `lseek64' function. */
#undef HAVE_LSEEK64
/* Define to 1 if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if you have the <net/route.h> header file. */
#undef HAVE_NET_ROUTE_H
/* Define to 1 if the system has the type `off64_t'. */
#undef HAVE_OFF64_T
/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define to 1 if the powf() function is available. */
#undef HAVE_POWF
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if the sinf() function is available. */
#undef HAVE_SINF
/* Define to 1 if you have the <sodium.h> header file. */
#undef HAVE_SODIUM_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if the strlcpy() function is available. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the <sys/byteorder.h> header file. */
#undef HAVE_SYS_BYTEORDER_H
/* Define to 1 if you have the <sys/endian.h> header file. */
#undef HAVE_SYS_ENDIAN_H
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define to 1 if you have the <sys/statvfs.h> header file. */
#undef HAVE_SYS_STATVFS_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/ucred.h> header file. */
#undef HAVE_SYS_UCRED_H
/* Define to 1 if you have the <sys/vfs.h> header file. */
#undef HAVE_SYS_VFS_H
/* Define to 1 if the tanf() function is available. */
#undef HAVE_TANF
/* Define to 1 if you have the `tgkill' function. */
#undef HAVE_TGKILL
/* Define to 1 if you have the <ucred.h> header file. */
#undef HAVE_UCRED_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the `section' variable attribute */
#undef HAVE_VAR_ATTRIBUTE_SECTION
/* Define to 1 if the system has the `section_seg' variable attribute */
#undef HAVE_VAR_ATTRIBUTE_SECTION_SEG
/* default instance path */
#undef INSTANCE_PATH
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* default Rhizome store directory */
#undef RHIZOME_STORE_PATH
/* default config directory */
#undef SERVAL_ETC_PATH
/* default log directory */
#undef SERVAL_LOG_PATH
/* default run directory */
#undef SERVAL_RUN_PATH
/* default Serval tmp directory */
#undef SERVAL_TMP_PATH
/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* default system log directory */
#undef SYSTEM_LOG_PATH
/* Use abstract namespace sockets for local communication. */
#undef USE_ABSTRACT_NAMESPACE

View File

@ -184,10 +184,12 @@ AC_CACHE_CHECK([Linux thread system calls], ac_cv_have_linux_threads, [
[ac_cv_have_linux_threads=yes] [ac_cv_have_linux_threads=yes]
) )
]) ])
AS_IF([test "x$ac_cv_have_linux_threads" = xyes], [AC_DEFINE([HAVE_LINUX_THREADS])]) AS_IF([test "x$ac_cv_have_linux_threads" = xyes],
[AC_DEFINE([HAVE_LINUX_THREADS], 1, [Linux threads are supported - gettid(2) and tgkill(2).])])
dnl Lazy way of checking for Linux dnl Lazy way of checking for Linux
AS_IF([test "x$ac_cv_header_linux_if_h" = xyes], [AC_DEFINE([USE_ABSTRACT_NAMESPACE])]) AS_IF([test "x$ac_cv_header_linux_if_h" = xyes],
[AC_DEFINE([USE_ABSTRACT_NAMESPACE], 1, [Use abstract namespace sockets for local communication.])])
AC_CACHE_CHECK([linker -z relro option], libc_cv_z_relro, [dnl AC_CACHE_CHECK([linker -z relro option], libc_cv_z_relro, [dnl
libc_cv_z_relro=no libc_cv_z_relro=no
@ -219,22 +221,26 @@ AS_IF([test x"$have_ssp" = "x1"], [
]) ])
dnl Some platforms still seem to lack the basic single precision trig and power related function. dnl Some platforms still seem to lack the basic single precision trig and power related function.
AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if you have the sinf() function.])) AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if the sinf() function is available.]))
AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if you have the cosf() function.])) AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if the cosf() function is available.]))
AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if you have the tanf() function.])) AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if the tanf() function is available.]))
AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if you have the asinf() function.])) AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if the asinf() function is available.]))
AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if you have the acosf() function.])) AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if the acosf() function is available.]))
AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if you have the atanf() function.])) AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if the atanf() function is available.]))
AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if you have the atan2f() function.])) AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if the atan2f() function is available.]))
AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if you have the ceilf() function.])) AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if the ceilf() function is available.]))
AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if you have the floorf() function.])) AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if the floorf() function is available.]))
AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if you have the powf() function.])) AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if the powf() function is available.]))
AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if you have the expf() function.])) AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if the expf() function is available.]))
AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if you have the logf() function.])) AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if the logf() function is available.]))
AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if you have the log10f() function.])) AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if the log10f() function is available.]))
dnl Check for strlcpy (eg Ubuntu) dnl Check for strlcpy (eg Ubuntu)
AC_SEARCH_LIBS([strlcpy], [], AC_DEFINE([HAVE_STRLCPY], [1], [Define to 1 if you have the strlcpy() function.])) AC_SEARCH_LIBS([strlcpy], [], AC_DEFINE([HAVE_STRLCPY], [1], [Define to 1 if the strlcpy() function is available.]))
dnl Put all the -DHAVE_BLAH=1 definitions into config.h instead of expanding
dnl them in @DEFS@ on the command-line of every compilation invoked by make.
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile

View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_POLL_H #ifdef HAVE_POLL_H
#include <poll.h> #include <poll.h>
#endif #endif

View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -49,6 +49,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA__FDQUEUE_H #ifndef __SERVAL_DNA__FDQUEUE_H
#define __SERVAL_DNA__FDQUEUE_H #define __SERVAL_DNA__FDQUEUE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_POLL_H #ifdef HAVE_POLL_H
#include <poll.h> #include <poll.h>
#endif #endif

View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include "instance.h" #include "instance.h"
#include "str.h" #include "str.h"

View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef HAVE_JNI_H #ifndef HAVE_JNI_H
#error <jni.h> is not available #error <jni.h> is not available
#endif #endif

4
lang.h
View File

@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA__LANG_H #ifndef __SERVAL_DNA__LANG_H
#define __SERVAL_DNA__LANG_H #define __SERVAL_DNA__LANG_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* Useful macros not specific to Serval DNA that assist with using the C /* Useful macros not specific to Serval DNA that assist with using the C
* language. * language.
*/ */

8
lsif.c
View File

@ -26,6 +26,10 @@
* *
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
@ -212,7 +216,7 @@ lsif(void) {
return 0; return 0;
} }
#endif #endif // SIOCGIFCONF
#ifdef HAVE_IFADDRS_H #ifdef HAVE_IFADDRS_H
int int
@ -258,4 +262,4 @@ doifaddrs(void) {
return 0; return 0;
} }
#endif #endif // HAVE_IFADDRS_H

View File

@ -16,6 +16,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <stdio.h> #include <stdio.h>

View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -53,6 +53,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
data structures (except for a binary extent for an audio sample block). data structures (except for a binary extent for an audio sample block).
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include "serval.h" #include "serval.h"
#include "conf.h" #include "conf.h"

4
net.h
View File

@ -19,6 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA__NET_H #ifndef __SERVAL_DNA__NET_H
#define __SERVAL_DNA__NET_H #define __SERVAL_DNA__NET_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h> // for size_t, ssize_t #include <sys/types.h> // for size_t, ssize_t
#include <sys/socket.h> // for struct sockaddr, socklen_t #include <sys/socket.h> // for struct sockaddr, socklen_t
#ifdef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H

4
os.h
View File

@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA__OS_H #ifndef __SERVAL_DNA__OS_H
#define __SERVAL_DNA__OS_H #define __SERVAL_DNA__OS_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h> // for off64_t #include <sys/types.h> // for off64_t
#include <stdio.h> // for NULL #include <stdio.h> // for NULL
#include <stdlib.h> #include <stdlib.h>

View File

@ -18,6 +18,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dirent.h> #include <dirent.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h> #include <assert.h>
#ifdef HAVE_SYS_STATVFS_H #ifdef HAVE_SYS_STATVFS_H

View File

@ -50,6 +50,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA__SERVAL_H #ifndef __SERVAL_DNA__SERVAL_H
#define __SERVAL_DNA__SERVAL_H #define __SERVAL_DNA__SERVAL_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h> #include <assert.h>
#include <dirent.h> #include <dirent.h>
#include <signal.h> #include <signal.h>

View File

@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SERVAL_DNA___SOCKET_H #ifndef __SERVAL_DNA___SOCKET_H
#define __SERVAL_DNA___SOCKET_H #define __SERVAL_DNA___SOCKET_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef WIN32 #ifdef WIN32
# include "win32/win32.h" # include "win32/win32.h"
#else #else

View File

@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __STRBUF_H__ #ifndef __STRBUF_H__
#define __STRBUF_H__ #define __STRBUF_H__
#include <stddef.h> #include <stddef.h>
#include "lang.h" #include "lang.h"

View File

@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __STRBUF_HELPERS_H__ #ifndef __STRBUF_HELPERS_H__
#define __STRBUF_HELPERS_H__ #define __STRBUF_HELPERS_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
// For socklen_t // For socklen_t
#ifdef WIN32 #ifdef WIN32
# include "win32/win32.h" # include "win32/win32.h"

View File

@ -20,6 +20,10 @@
#ifndef __STRLCPY_H__ #ifndef __STRLCPY_H__
#define __STRLCPY_H__ #define __STRLCPY_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
// Do not use strlcpy() in Serval DNA source code, use strncpy_nul() or // Do not use strlcpy() in Serval DNA source code, use strncpy_nul() or
// buf_strncpy_nul() from "str.h" instead. This strlcpy() is provided only // buf_strncpy_nul() from "str.h" instead. This strlcpy() is provided only
// because it is needed by sqlite3.c. // because it is needed by sqlite3.c.

4
uuid.c
View File

@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define __SERVAL_DNA__UUID_H_INLINE #define __SERVAL_DNA__UUID_H_INLINE
#include "uuid.h" #include "uuid.h"
#include "os.h" #include "os.h"

View File

@ -45,6 +45,10 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <stdio.h> #include <stdio.h>