~ubuntu-branches/ubuntu/utopic/golang/utopic

« back to all changes in this revision

Viewing changes to misc/cgo/testso/cgoso_c.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
// +build ignore
6
6
 
 
7
#ifdef WIN32
 
8
// A Windows DLL is unable to call an arbitrary function in
 
9
// the main executable. Work around that by making the main
 
10
// executable pass the callback function pointer to us.
 
11
void (*goCallback)(void);
 
12
__declspec(dllexport) void setCallback(void *f)
 
13
{
 
14
        goCallback = (void (*)())f;
 
15
}
 
16
__declspec(dllexport) void sofunc(void);
 
17
#else
 
18
extern void goCallback(void);
 
19
void setCallback(void *f) { (void)f; }
 
20
#endif
 
21
 
7
22
void sofunc(void)
8
23
{
9
 
        extern void goCallback(void);
10
24
        goCallback();
11
25
}