From: Heikki Lindholm Date: Sun, 18 Oct 2009 06:28:49 +0000 (+0000) Subject: cosmetics X-Git-Tag: initial-import-from-subversion-38251~23351 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e20c445682f63dfab3058acfc0e61a7a48ca25a;p=oweals%2Fgnunet.git cosmetics --- diff --git a/configure.ac b/configure.ac index d692a1de4..b05ba374b 100644 --- a/configure.ac +++ b/configure.ac @@ -69,10 +69,10 @@ DEFAULT_INTERFACE="\"eth0\"" # Check system type case "$host_os" in *darwin* | *rhapsody* | *macosx*) - AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) + AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system]) CFLAGS="-no-cpp-precomp -fno-common $CFLAGS" AC_MSG_WARN([The VPN application cannot be compiled on your OS]) - build_target="macosx" + build_target="darwin" DEFAULT_INTERFACE="\"en0\"" LIBPREFIX= DLLDIR=lib @@ -155,7 +155,7 @@ AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should AC_SUBST(DEFAULT_INTERFACE) AC_MSG_CHECKING([for build target]) -AM_CONDITIONAL(MACOSX, test "$build_target" = "macosx") +AM_CONDITIONAL(DARWIN, test "$build_target" = "darwin") AM_CONDITIONAL(CYGWIN, test "$build_target" = "cygwin") AM_CONDITIONAL(MINGW, test "$build_target" = "mingw") AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris") diff --git a/src/include/platform.h b/src/include/platform.h index a649d3aa5..257fc7c6b 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -128,7 +128,7 @@ #ifdef GNUNET_freeBSD #include #endif -#ifdef OSX +#ifdef DARWIN #include #include #include @@ -192,11 +192,10 @@ #define __BIG_ENDIAN BIG_ENDIAN #endif -#ifdef OSX -#define socklen_t unsigned int +#ifdef DARWIN #define __BYTE_ORDER BYTE_ORDER #define __BIG_ENDIAN BIG_ENDIAN - /* not available on OS X, override configure */ + /* not available on darwin, override configure */ #undef HAVE_STAT64 #undef HAVE_MREMAP #endif diff --git a/src/util/disk.c b/src/util/disk.c index c3d6f650b..40d637ee3 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -41,14 +41,10 @@ -#if LINUX || CYGWIN +#if defined(LINUX) || defined(CYGWIN) #include #else -#ifdef SOMEBSD -#include -#include -#else -#ifdef OSX +#if defined(SOMEBSD) || defined(DARWIN) #include #include #else @@ -66,15 +62,10 @@ #endif #endif #endif -#endif -#ifndef SOMEBSD -#ifndef WINDOWS -#ifndef OSX +#if !defined(SOMEBSD) && !defined(DARWIN) && !defined(WINDOWS) #include #endif -#endif -#endif #if LINUX #include #endif @@ -1584,7 +1575,7 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h) if (ret != GNUNET_OK) SetErrnoFromWinError (GetLastError ()); return ret; -#elif FREEBSD || OPENBSD || OSX +#elif defined(FREEBSD) || defined(OPENBSD) || defined(DARWIN) return fsync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK; #else return fdatasync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK; diff --git a/src/util/network.c b/src/util/network.c index f3bf7ae83..7039ff54a 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -124,7 +124,7 @@ socket_set_inheritable (const struct GNUNET_NETWORK_Handle -#ifdef OSX +#ifdef DARWIN /** * The MSG_NOSIGNAL equivalent on Mac OS X * @@ -204,7 +204,7 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "socket_set_inheritable"); #endif -#ifdef OSX +#ifdef DARWIN socket_set_nosigpipe (ret); #endif socket_set_nodelay (ret); @@ -500,7 +500,7 @@ GNUNET_NETWORK_socket_create (int domain, int type, int protocol) GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "socket_set_inheritable"); #endif -#ifdef OSX +#ifdef DARWIN socket_set_nosigpipe (ret); #endif if (type == SOCK_STREAM) diff --git a/src/util/os_installation.c b/src/util/os_installation.c index a8789281e..f27d195c3 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -42,7 +42,7 @@ extern "C" #include "gnunet_configuration_lib.h" #include "gnunet_disk_lib.h" #include "gnunet_os_lib.h" -#if OSX +#if DARWIN #include #include #endif @@ -137,7 +137,7 @@ get_path_from_module_filename () } #endif -#if OSX +#if DARWIN typedef int (*MyNSGetExecutablePathProto) (char *buf, size_t * bufsize); static char * @@ -285,7 +285,7 @@ os_get_gnunet_path () if (ret != NULL) return ret; #endif -#if OSX +#if DARWIN ret = get_path_from_dyld_image (); if (ret != NULL) return ret; @@ -325,7 +325,7 @@ os_get_exec_path () if (ret != NULL) return ret; #endif -#if OSX +#if DARWIN ret = get_path_from_NSGetExecutablePath (); if (ret != NULL) return ret; diff --git a/src/util/os_load.c b/src/util/os_load.c index a5a197ebe..e2ec8349c 100644 --- a/src/util/os_load.c +++ b/src/util/os_load.c @@ -49,7 +49,7 @@ #endif #endif -#ifdef OSX +#ifdef DARWIN #include static processor_cpu_load_info_t prev_cpu_load; @@ -76,7 +76,7 @@ static int currentIOLoad; static double agedIOLoad = -1; -#ifdef OSX +#ifdef DARWIN static int initMachCpuStats () { @@ -196,7 +196,7 @@ updateUsage () } #endif -#ifdef OSX +#ifdef DARWIN { unsigned int cpu_count; processor_cpu_load_info_t cpu_load; @@ -284,7 +284,7 @@ updateUsage () vm_deallocate (mach_task_self (), (vm_address_t) cpu_load, (vm_size_t) (cpu_msg_count * sizeof (*cpu_load))); - currentIOLoad = -1; /* FIXME-OSX! */ + currentIOLoad = -1; /* There's no IO load meter on darwin */ return GNUNET_OK; } else @@ -623,7 +623,7 @@ void __attribute__ ((constructor)) GNUNET_cpustats_ltdl_init () proc_stat = fopen ("/proc/stat", "r"); if (NULL == proc_stat) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", "/proc/stat"); -#elif OSX +#elif defined(DARWIN) initMachCpuStats (); #elif MINGW InitWinEnv (NULL); @@ -642,7 +642,7 @@ void __attribute__ ((destructor)) GNUNET_cpustats_ltdl_fini () fclose (proc_stat); proc_stat = NULL; } -#elif OSX +#elif defined(DARWIN) GNUNET_free_non_null (prev_cpu_load); #elif MINGW ShutdownWinEnv ();