From: Kefu Chai Date: Sun, 10 Sep 2017 18:00:44 +0000 (+0800) Subject: compat: consolidate definitions of osx and freebsd X-Git-Tag: v13.0.1~880^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=56a897449b7e90495864d6b1d212b0e6e0cc10b2;p=ceph.git compat: consolidate definitions of osx and freebsd on osx, ENODATA = 96, so we need to fix it. also define CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE for osx, ceph_time.h defines this also, but i don't want to include compat.h in ceph_time.h at this moment. and silence the warning of #warning ENODATA already defined to a value different from 87 (ENOATRR), refining to fix because it is fired everywhere on osx when "compat.h" is included. Signed-off-by: Kefu Chai --- diff --git a/src/include/compat.h b/src/include/compat.h index d4120478c88e..0dad0ea02064 100644 --- a/src/include/compat.h +++ b/src/include/compat.h @@ -24,10 +24,22 @@ // And all compatibility stuff is standard mounted on this #define PROCPREFIX "/compat/linux" +#ifndef MSG_MORE +#define MSG_MORE 0 +#endif + +#ifndef O_DSYNC +#define O_DSYNC O_SYNC +#endif + +/* And include the extra required include file */ +#include + +#endif /* __FreeBSD__ */ + +#if defined(__APPLE__) || defined(__FreeBSD__) /* Make sure that ENODATA is defined in the correct way */ -#ifndef ENODATA -#define ENODATA ENOATTR -#else +#ifdef ENODATA #if (ENODATA == 9919) // #warning ENODATA already defined to be 9919, redefining to fix // Silencing this warning because it fires at all files where compat.h @@ -41,18 +53,11 @@ // at the location of usage and report a possible confict. // This is left up to a future improvement #elif (ENODATA != 87) -#warning ENODATA already defined to a value different from 87 (ENOATRR), refining to fix +// #warning ENODATA already defined to a value different from 87 (ENOATRR), refining to fix #endif #undef ENODATA -#define ENODATA ENOATTR -#endif -#ifndef MSG_MORE -#define MSG_MORE 0 -#endif - -#ifndef O_DSYNC -#define O_DSYNC O_SYNC #endif +#define ENODATA ENOATTR // Fix clock accuracy #if !defined(CLOCK_MONOTONIC_COARSE) @@ -70,12 +75,6 @@ #endif #endif -/* And include the extra required include file */ -#include - -#endif /* !__FreeBSD__ */ - -#if defined(__APPLE__) || defined(__FreeBSD__) /* get PATH_MAX */ #include