Created
January 8, 2017 08:03
-
-
Save roowe/6ce6968448b8f3bcacc7aae8c76719b2 to your computer and use it in GitHub Desktop.
头文件循环include
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-ifndef(DEFINE_a_HRL). | |
-define(DEFINE_a_HRL, true). | |
-include("b.hrl"). | |
-define(a, a). | |
-endif. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-ifndef(DEFINE_b_HRL). | |
-define(DEFINE_b_HRL, true). | |
-include("a.hrl"). | |
-define(b, b). | |
-endif. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(main). | |
-export([start/0]). | |
start() -> | |
main1:start(), | |
main2:start(), | |
main3:start(), | |
ok. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(main1). | |
-include("a.hrl"). | |
-export([start/0]). | |
start() -> | |
io:format("~p ~p~n", [?a, ?b]). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(main2). | |
-include("a.hrl"). | |
-include("b.hrl"). | |
-export([start/0]). | |
start() -> | |
io:format("~p ~p~n", [?a, ?b]). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(main3). | |
-include("b.hrl"). | |
-export([start/0]). | |
start() -> | |
io:format("~p ~p~n", [?a, ?b]). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment