<!doctype html>
<html>
<head>
<meta name='viewport'content='width=device-width,initial-scale=1'>
<style>
.red {
background-color: #FFD0D0;
}
.cyan {
background-color: cyan;
}
.black {
background-color: black;
color: white;
}
.green {
background-color: #98FFA6;
color: white;
}
.magenta {
background-color: #F998FF;
color: white;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
tr:nth-child(even) {
background-color: #f0f0f0;
}
pre {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.function-title {
margin-top: 5px;
margin-bottom: 5px;
}
.centered {
margin-left: auto;
margin-right: auto;
}
.expansion-view {
background-color: rgba(0, 0, 0, 0);
margin-left: 0px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
}
table {
border: 2px solid #dbdbdb;
border-collapse: collapse;
}
.numeric {
text-align: right;
}
.tooltips {
position: relative;
display: inline;
background-color: #fffee6;
text-decoration: none;
}
.tooltips span {
position: absolute;
width:140px;
color: #FFFFFF;
background: #000000;
height: 30px;
line-height: 30px;
text-align: center;
visibility: hidden;
border-radius: 6px;
}
.tooltips span:after {
content: '';
position: absolute;
top: 100%;
left: 50%;
margin-left: -8px;
width: 0; height: 0;
border-top: 8px solid #000000;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
}
:hover.tooltips span {
visibility: visible;
opacity: 0.8;
bottom: 30px;
left: 50%;
margin-left: -76px;
z-index: 999;
}
th, td {
vertical-align: top;
padding: 2px 5px;
border-collapse: collapse;
} </style>
</head>
<body>
<div class='function-title'><pre>/Users/harlanhaskins/macro.c:</pre></div><table class='centered'>
<tr>
<td class='numeric'></td>
<td class='numeric'><pre>1</pre></td>
<td><pre>
#include <stdio.h></pre>
</tr>
<tr>
<td class='numeric'></td>
<td class='numeric'><pre>2</pre></td>
<td><pre>
</pre>
</tr>
<tr>
<td class='numeric'><pre>2</pre></td>
<td class='numeric'><pre>3</pre></td>
<td><pre>
#define MY_MACRO(x, y) do { \</pre>
</tr>
<tr>
<td class='numeric'><pre>2</pre></td>
<td class='numeric'><pre>4</pre></td>
<td><pre>
typeof(x) __x = (x); \</pre>
</tr>
<tr>
<td class='numeric'><pre>2</pre></td>
<td class='numeric'><pre>5</pre></td>
<td><pre>
typeof(y) __y = (y); \</pre>
</tr>
<tr>
<td class='numeric'><pre>2</pre></td>
<td class='numeric'><pre>6</pre></td>
<td><pre>
if (__x == 10) \</pre>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>7</pre></td>
<td><pre>
printf("%d", __x * __y); \</pre>
</tr>
<tr>
<td class='numeric'><pre>2</pre></td>
<td class='numeric'><pre>8</pre></td>
<td><pre>
} while (0)</pre>
</tr>
<tr>
<td class='numeric'></td>
<td class='numeric'><pre>9</pre></td>
<td><pre>
</pre>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>10</pre></td>
<td><pre>
int main() {</pre>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>11</pre></td>
<td><pre>
;<span class='cyan'>MY_MACRO</span>(10, 10); MY_MACRO(20, 10); // line 11</pre>
<div class='expansion-view'>
<table>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>3</pre></td>
<td><pre>
#define MY_MACRO(x, y) do { \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>4</pre></td>
<td><pre>
typeof(x) __x = (x); \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>5</pre></td>
<td><pre>
typeof(y) __y = (y); \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>6</pre></td>
<td><pre>
if (__x == 10) \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>7</pre></td>
<td><pre>
printf("%d", __x * __y); \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>8</pre></td>
<td><pre>
} while (0)</pre>
</td>
</tr>
</table>
</div>
<div class='expansion-view'>
<pre> ;MY_MACRO(10, 10); <span class='cyan'>MY_MACRO</span>(20, 10); // line 11</pre>
<table>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>3</pre></td>
<td><pre>
#define MY_MACRO(x, y) do { \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>4</pre></td>
<td><pre>
typeof(x) __x = (x); \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>5</pre></td>
<td><pre>
typeof(y) __y = (y); \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>6</pre></td>
<td><pre>
if (__x == 10) \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>0</pre></td>
<td class='numeric'><pre>7</pre></td>
<td><pre>
<span class='red'>printf("%d", __x * __y)</span>; \</pre>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>8</pre></td>
<td><pre>
} while (0)</pre>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>12</pre></td>
<td><pre>
return 0;</pre>
</tr>
<tr>
<td class='numeric'><pre>1</pre></td>
<td class='numeric'><pre>13</pre></td>
<td><pre>
}</pre>
</tr>
</table>
</body>
</html>