Merging MinGW changes
This commit is contained in:
		| @@ -1,33 +1,33 @@ | ||||
|  | ||||
| #include <windows.h> | ||||
|  | ||||
| BOOL WINAPI | ||||
| DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) | ||||
| { | ||||
| 	switch (dwReason) | ||||
| 	{ | ||||
| 		case DLL_PROCESS_ATTACH: | ||||
| 			printf ("DLL Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_PROCESS_DETACH: | ||||
| 			printf ("DLL Detached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_ATTACH: | ||||
| 			printf ("DLL Thread Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_DETACH: | ||||
| 			printf ("DLL Thread Detached.\n"); | ||||
| 			break; | ||||
| 	} | ||||
| 	return TRUE; | ||||
| } | ||||
|  | ||||
| void | ||||
| Test () | ||||
| { | ||||
| 	printf ("Test Function called!\n"); | ||||
| } | ||||
|  | ||||
|  | ||||
| #include <windows.h> | ||||
|  | ||||
| BOOL WINAPI | ||||
| DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) | ||||
| { | ||||
| 	switch (dwReason) | ||||
| 	{ | ||||
| 		case DLL_PROCESS_ATTACH: | ||||
| 			printf ("DLL Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_PROCESS_DETACH: | ||||
| 			printf ("DLL Detached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_ATTACH: | ||||
| 			printf ("DLL Thread Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_DETACH: | ||||
| 			printf ("DLL Thread Detached.\n"); | ||||
| 			break; | ||||
| 	} | ||||
| 	return TRUE; | ||||
| } | ||||
|  | ||||
| void | ||||
| Test () | ||||
| { | ||||
| 	printf ("Test Function called!\n"); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,44 +1,44 @@ | ||||
| // | ||||
| // This is a C++ version of the code in dll.c. NOTE that you need to put | ||||
| // extern "C" { ... } around DllMain or it will not be called when your | ||||
| // Dll starts up! (It will get name mangled as a C++ function and the C | ||||
| // default version in libmingw32.a will get called instead.) | ||||
| // | ||||
|  | ||||
| #include <windows.h> | ||||
|  | ||||
| #include <iostream> | ||||
|  | ||||
| extern "C" { | ||||
|  | ||||
| BOOL WINAPI | ||||
| DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) | ||||
| { | ||||
| 	switch (dwReason) | ||||
| 	{ | ||||
| 		case DLL_PROCESS_ATTACH: | ||||
| 			cout << "Dll Attached" << endl ; | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_PROCESS_DETACH: | ||||
| 			cout << "Dll Detached" << endl ; | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_ATTACH: | ||||
| 			printf ("DLL Thread Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_DETACH: | ||||
| 			printf ("DLL Thread Detached.\n"); | ||||
| 			break; | ||||
| 	} | ||||
| 	return TRUE; | ||||
| } | ||||
|  | ||||
| void | ||||
| Test () | ||||
| { | ||||
| 	printf ("Test Function called!\n"); | ||||
| } | ||||
|  | ||||
| }; | ||||
| // | ||||
| // This is a C++ version of the code in dll.c. NOTE that you need to put | ||||
| // extern "C" { ... } around DllMain or it will not be called when your | ||||
| // Dll starts up! (It will get name mangled as a C++ function and the C | ||||
| // default version in libmingw32.a will get called instead.) | ||||
| // | ||||
|  | ||||
| #include <windows.h> | ||||
|  | ||||
| #include <iostream> | ||||
|  | ||||
| extern "C" { | ||||
|  | ||||
| BOOL WINAPI | ||||
| DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) | ||||
| { | ||||
| 	switch (dwReason) | ||||
| 	{ | ||||
| 		case DLL_PROCESS_ATTACH: | ||||
| 			cout << "Dll Attached" << endl ; | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_PROCESS_DETACH: | ||||
| 			cout << "Dll Detached" << endl ; | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_ATTACH: | ||||
| 			printf ("DLL Thread Attached.\n"); | ||||
| 			break; | ||||
|  | ||||
| 		case DLL_THREAD_DETACH: | ||||
| 			printf ("DLL Thread Detached.\n"); | ||||
| 			break; | ||||
| 	} | ||||
| 	return TRUE; | ||||
| } | ||||
|  | ||||
| void | ||||
| Test () | ||||
| { | ||||
| 	printf ("Test Function called!\n"); | ||||
| } | ||||
|  | ||||
| }; | ||||
|   | ||||
| @@ -1,2 +1,2 @@ | ||||
| EXPORTS | ||||
| Test | ||||
| EXPORTS | ||||
| Test | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| #include <stdio.h> | ||||
|  | ||||
| extern void Test(); | ||||
|  | ||||
| int main() | ||||
| { | ||||
| 	printf ("Program started.\n"); | ||||
| 	Test (); | ||||
| 	printf ("Program ends.\n"); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| #include <stdio.h> | ||||
|  | ||||
| extern void Test(); | ||||
|  | ||||
| int main() | ||||
| { | ||||
| 	printf ("Program started.\n"); | ||||
| 	Test (); | ||||
| 	printf ("Program ends.\n"); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
|  | ||||
| Dll dll.dll : dll.c ; | ||||
|  | ||||
| ImportLib libdll.a : dll.def ; | ||||
|  | ||||
|  | ||||
| Main exe.exe : exe.c ; | ||||
|  | ||||
| LinkLibraries exe.exe : libdll.a ; | ||||
|  | ||||
| DEPENDS exe.exe : dll.dll ; | ||||
|  | ||||
| LINKFLAGS on exe.exe = $(LINKFLAGS) -L. ; | ||||
|  | ||||
|  | ||||
| Dll dll.dll : dll.c ; | ||||
|  | ||||
| ImportLib libdll.a : dll.def ; | ||||
|  | ||||
|  | ||||
| Main exe.exe : exe.c ; | ||||
|  | ||||
| LinkLibraries exe.exe : libdll.a ; | ||||
|  | ||||
| DEPENDS exe.exe : dll.dll ; | ||||
|  | ||||
| LINKFLAGS on exe.exe = $(LINKFLAGS) -L. ; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user