summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorSpencer Jackson <spencer.jackson@mongodb.com>2015-07-23 17:24:01 -0400
committerSpencer Jackson <spencer.jackson@mongodb.com>2015-07-27 14:52:41 -0400
commit11db3b9b0c6287ec549de2f7ea50f985d8f565f5 (patch)
tree92aa9b919be70007c1c31953be56705d9557f8f6 /SConstruct
parent6fcca346efc8817c557ac45041700318efb863d7 (diff)
downloadmongo-11db3b9b0c6287ec549de2f7ea50f985d8f565f5.tar.gz
SERVER-19458: Add memory zeroing utility
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct23
1 files changed, 23 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index e60a7f350c8..5e02f368632 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1718,6 +1718,29 @@ def doConfigure(myenv):
conf.Finish()
+ def CheckMemset_s(context):
+ test_body = """
+ #define __STDC_WANT_LIB_EXT1__ 1
+ #include <cstring>
+ int main(int argc, char* argv[]) {
+ void* data = nullptr;
+ return memset_s(data, 0, 0, 0);
+ }
+ """
+
+ context.Message('Checking for memset_s... ')
+ ret = context.TryLink(textwrap.dedent(test_body), ".cpp")
+ context.Result(ret)
+ return ret
+
+ conf = Configure(env, custom_tests = {
+ 'CheckMemset_s' : CheckMemset_s,
+ })
+ if conf.CheckMemset_s():
+ conf.env.SetConfigHeaderDefine("MONGO_CONFIG_HAVE_MEMSET_S")
+
+ conf.Finish()
+
# If we are using libstdc++, check to see if we are using a libstdc++ that is older than
# our GCC minimum of 4.8.2. This is primarly to help people using clang on OS X but
# forgetting to use --libc++ (or set the target OS X version high enough to get it as the