Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Packetdrill_tarr_ext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Stefan Gense
Packetdrill_tarr_ext
Commits
090e0a0b
Commit
090e0a0b
authored
6 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Fix #ifdef for Apple and Solaris.
parent
db3bf25b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gtests/net/packetdrill/lexer.l
+12
-1
12 additions, 1 deletion
gtests/net/packetdrill/lexer.l
with
12 additions
and
1 deletion
gtests/net/packetdrill/lexer.l
+
12
−
1
View file @
090e0a0b
...
...
@@ -133,7 +133,7 @@ static s64 hextol(const char *s)
}
enum ifdef_os {
Linux_IFDEF = 1, FreeBSD_IFDEF, NetBSD_IFDEF, OpenBSD_IFDEF, Omnet_IFDEF, Apple_IFDEF
Linux_IFDEF = 1, FreeBSD_IFDEF, NetBSD_IFDEF, OpenBSD_IFDEF, Omnet_IFDEF, Apple_IFDEF
, Solaris_IFDEF
};
#define MAX_IFDEF_DEPTH 1
...
...
@@ -154,6 +154,8 @@ static inline int get_os_name_length(enum ifdef_os os) {
return strlen("Omnet");
case Apple_IFDEF:
return strlen("Apple");
case Solaris_IFDEF:
return strlen("Solaris");
default:
return -1;
}
...
...
@@ -175,6 +177,9 @@ static inline bool ignore_ifdef(enum ifdef_os os) {
#endif
#ifdef __APPLE__
case Apple_IFDEF:
#endif
#ifdef __SunOS_5_11
case Solaris_IFDEF:
#endif
/* no need to handle Omnet here */
return false;
...
...
@@ -255,6 +260,8 @@ c_comment \/\*(([^*])|(\*[^\/]))*\*\/
* #ifdef NetBSD => Code that only NetBSD hosts should execute
* #ifdef OpenBSD => Code that only OpenBSD hosts should execute
* #ifdef Omnet => Code that only an Omnet based simulation should execute
* #ifdef Apple => Code that only Apple hosts should execute
* #ifdef Solaris => Code that only Solaris hosts should execute
*
* the pattern for using #ifdef is like this:
* #ifdef Linux
...
...
@@ -273,6 +280,8 @@ ifdef_linux {ifdef_begin}(?i:Linux){end_matcher}{ifdef_end}
ifdef_netbsd {ifdef_begin}(?i:NetBSD){end_matcher}{ifdef_end}
ifdef_openbsd {ifdef_begin}(?i:OpenBSD){end_matcher}{ifdef_end}
ifdef_omnet {ifdef_begin}(?i:Omnet){end_matcher}{ifdef_end}
ifdef_apple {ifdef_begin}(?i:Apple){end_matcher}{ifdef_end}
ifdef_solaris {ifdef_begin}(?i:Solaris){end_matcher}{ifdef_end}
/* The regexp for code snippets is analogous to that for C comments.
* Here is a summary of the regexp for code snippets:
...
...
@@ -696,6 +705,8 @@ NULL return NULL_;
{ifdef_netbsd} handle_ifdef(NetBSD_IFDEF, yytext);
{ifdef_openbsd} handle_ifdef(OpenBSD_IFDEF, yytext);
{ifdef_omnet} handle_ifdef(Omnet_IFDEF, yytext);
{ifdef_apple} handle_ifdef(Apple_IFDEF, yytext);
{ifdef_solaris} handle_ifdef(Solaris_IFDEF, yytext);
{code} yylval.string = code(yytext); return CODE;
{ipv4_addr} yylval.string = strdup(yytext); return IPV4_ADDR;
{ipv6_addr} yylval.string = strdup(yytext); return IPV6_ADDR;
...
...
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