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
41200b47
Commit
41200b47
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Have autoconf check whether enums are signed.
Fixes bug 7727; fix on 0.2.4.10-alpha.
parent
0e597471
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
changes/signof_enum
+3
-0
3 additions, 0 deletions
changes/signof_enum
configure.ac
+6
-0
6 additions, 0 deletions
configure.ac
src/common/compat.h
+1
-2
1 addition, 2 deletions
src/common/compat.h
src/win32/orconfig.h
+1
-0
1 addition, 0 deletions
src/win32/orconfig.h
with
11 additions
and
2 deletions
changes/signof_enum
+
3
−
0
View file @
41200b47
...
...
@@ -2,3 +2,6 @@
- Use Ville Laurikari's implementation of AX_CHECK_SIGN() to determine
the signs of types during autoconf. This is better than our old
approach, which didn't work when cross-compiling.
- Detect the sign of enum values, rather than assuming that MSC is the
only compiler where enum types are all signed. Fix for bug 7727;
bugfix on 0.2.4.10-alpha.
This diff is collapsed.
Click to expand it.
configure.ac
+
6
−
0
View file @
41200b47
...
...
@@ -984,6 +984,12 @@ if test "$tor_cv_size_t_signed" = yes; then
AC_MSG_ERROR([You have a signed size_t; that's grossly nonconformant.])
fi
AX_CHECK_SIGN([enum always],
[ AC_DEFINE(ENUM_VALS_ARE_SIGNED, 1, [Define if enum is always signed]) ],
[ : ], [
enum always { AAA, BBB, CCC };
])
AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
...
...
This diff is collapsed.
Click to expand it.
src/common/compat.h
+
1
−
2
View file @
41200b47
...
...
@@ -136,8 +136,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#define DBL_TO_U64(x) ((uint64_t) (x))
#endif
#if defined(_MSC_VER)
/* XXXX024 we should instead have a more general check for "Is enum signed?"*/
#ifdef ENUM_VALS_ARE_SIGNED
#define ENUM_BF(t) unsigned
#else
/** Wrapper for having a bitfield of an enumerated type. Where possible, we
...
...
This diff is collapsed.
Click to expand it.
src/win32/orconfig.h
+
1
−
0
View file @
41200b47
...
...
@@ -256,3 +256,4 @@
#define CURVE25519_ENABLED
#define USE_CURVE25519_DONNA
#define ENUM_VALS_ARE_SIGNED 1
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