mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
25 lines
430 B
C++
25 lines
430 B
C++
typedef int PRUint32;
|
|
typedef int PRInt32;
|
|
|
|
typedef PRUint32 nsresult;
|
|
|
|
inline int NS_FAILED(nsresult _nsresult) {
|
|
return _nsresult & 0x80000000;
|
|
}
|
|
|
|
inline int NS_SUCCEEDED(nsresult _nsresult) {
|
|
return !(_nsresult & 0x80000000);
|
|
}
|
|
|
|
int SomeFunc(nsresult *rv);
|
|
|
|
nsresult foo(__attribute__((user("NS_outparam"))) int *a) {
|
|
nsresult rv;
|
|
int i = SomeFunc(&rv);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
*a = i;
|
|
return 0;
|
|
}
|