Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
f619c460
Commit
f619c460
authored
20 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Add an autoconf test to make sure that memset(&ptr, 0, sizeof(ptr)) and ptr=NULL are equivalent
svn:r2536
parent
56a592db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
configure.in
+15
-0
15 additions, 0 deletions
configure.in
src/common/util.h
+4
-0
4 additions, 0 deletions
src/common/util.h
src/win32/orconfig.h
+4
-2
4 additions, 2 deletions
src/win32/orconfig.h
with
23 additions
and
2 deletions
configure.in
+
15
−
0
View file @
f619c460
...
...
@@ -195,6 +195,21 @@ if test $tor_cv_unaligned_ok = yes; then
[Define to 1 iff unaligned int access is allowed])
fi
# Now make sure that NULL can be represented as zero bytes.
AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>
int main () { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
return memcmp(&p1,&p2,sizeof(char*)); }]])],
[tor_cv_null_is_zero=yes],
[tor_cv_null_is_zero=no],
[tor_cv_null_is_zero=cross])])
if test $tor_cv_null_is_zero = yes; then
AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
[Define to 1 iff memset(0) sets pointers to NULL])
fi
# $prefix stores the value of the --prefix command line option, or
# NONE if the option wasn't set. In the case that it wasn't set, make
# it be the default, so that we can use it to expand directories now.
...
...
This diff is collapsed.
Click to expand it.
src/common/util.h
+
4
−
0
View file @
f619c460
...
...
@@ -20,6 +20,10 @@
#include
<time.h>
#endif
#ifndef NULL_REP_IS_ZERO_BYTES
#error "It seems your platform does not represent NULL as zero. We can't cope."
#endif
#if _MSC_VER > 1300
#include
<winsock2.h>
#include
<ws2tcpip.h>
...
...
This diff is collapsed.
Click to expand it.
src/win32/orconfig.h
+
4
−
2
View file @
f619c460
...
...
@@ -124,11 +124,13 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 iff unaligned int access is allowed */
#define NULL_REP_IS_ZERO_BYTES 1
/* Name of package */
#define PACKAGE "tor"
/* Def
ine to the address where bug reports for this package should be sent. */
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment