Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
3e86a4ea
Commit
3e86a4ea
authored
Jun 29, 2007
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread safety to the masses
parent
7c97b88e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
skeletons/asn_internal.h
skeletons/asn_internal.h
+12
-5
skeletons/asn_system.h
skeletons/asn_system.h
+7
-1
No files found.
skeletons/asn_internal.h
View file @
3e86a4ea
/*-
/*-
* Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
* Copyright (c) 2003, 2004, 2005
, 2007
Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
* Redistribution and modifications are permitted subject to BSD license.
*/
*/
...
@@ -35,7 +35,14 @@ int get_asn1c_environment_version(void); /* Run-time version */
...
@@ -35,7 +35,14 @@ int get_asn1c_environment_version(void); /* Run-time version */
#ifndef ASN_DEBUG
/* If debugging code is not defined elsewhere... */
#ifndef ASN_DEBUG
/* If debugging code is not defined elsewhere... */
#if EMIT_ASN_DEBUG == 1
/* And it was asked to emit this code... */
#if EMIT_ASN_DEBUG == 1
/* And it was asked to emit this code... */
#ifdef __GNUC__
#ifdef __GNUC__
#ifdef ASN_THREAD_SAFE
#define asn_debug_indent 0
#endif
int
asn_debug_indent
;
#endif
#define ASN_DEBUG(fmt, args...) do { \
#define ASN_DEBUG(fmt, args...) do { \
int adi = asn_debug_indent; \
while(adi--) fprintf(stderr, " "); \
fprintf(stderr, fmt, ##args); \
fprintf(stderr, fmt, ##args); \
fprintf(stderr, " (%s:%d)\n", \
fprintf(stderr, " (%s:%d)\n", \
__FILE__, __LINE__); \
__FILE__, __LINE__); \
...
...
skeletons/asn_system.h
View file @
3e86a4ea
/*-
/*-
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Copyright (c) 2003, 2004, 2007 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
* Redistribution and modifications are permitted subject to BSD license.
*/
*/
/*
/*
...
@@ -103,6 +104,11 @@ typedef unsigned int uint32_t;
...
@@ -103,6 +104,11 @@ typedef unsigned int uint32_t;
#endif
#endif
#endif
#endif
/* Figure out if thread safety is requested */
#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || define(_REENTRANT))
#define ASN_THREAD_SAFE
#endif
/* Thread safety */
#ifndef offsetof
/* If not defined by <stddef.h> */
#ifndef offsetof
/* If not defined by <stddef.h> */
#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0))
#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0))
#endif
/* offsetof */
#endif
/* offsetof */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment